I run into the same problems with activex controls such as imageList comboBox.
What I did was to substitute PEMStatus with type(). In your case you could
change
IF PEMSTATUS(oControl,"Width",5) AND !PEMSTATUS(oControl,"nOrigWidth",5)
for
if (type("oControl.width") == "N") AND (type("oControl.nOrigWidth") <> "N")
>For some reason, PEMSTATUS() returns .T. when I use it to determine if a subclassed page has a width property even though the page does NOT have a width property. PEMSTATUS() correctly returns .F. if I run it against a page of the VFP baseclasses. Below is a more detailed explanation of what I've done.
>
>I began by creating my own page class (subclassed from the VFP base). I then subclassed a pageframe and set it's memberclass to my new page class. Great so far.
>
>However, we have a resizer class on our forms that begins by saving initial height, width, top, left, fontsize, etc values of each object on a form. The resizer does the following bit of code:
>
> lparameters oControl
>
> WITH oControl
> *--- Save Width
> IF PEMSTATUS(oControl,"Width",5) AND !PEMSTATUS(oControl,"nOrigWidth",5)
> .AddProperty("nOrigWidth", .Width)
> ENDIF
> ...
>
> ENDWITH
>
>
>This works great when I drop a VFP base pageframe on a form and resize it. However, when I drop my subclassed pageframe, I get an error in the above code. The first PEMSTATUS() checking to see if the control (in this case my subclassed page) has a width returns a .T. (which I did NOT expect ... and no, I did not add a width property to my page class). But, when it tries to do the .AddProperty code, it bombs saying that the page does not have a width property.
>
>Even from the debug window, the pemstatus continually returns a .T. stating that my page does have a Width property and yet if I look at the properties of my page in the debugger window, there is NO Width property.
>
>Has anyone run into this? Can anyone re-create this so I know I'm not loosing my mind? <g> Lastly, if, for some odd reason, this is considered "normal" behavior, how can I truly determine that the page does NOT have a width property?
>
>Thanks so much to anyone who can help with this!