Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
PEMSTATUS() and DLL's
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00454743
Message ID:
00454745
Views:
21
PEMSTATUS() is not designed to work with COM objects. It only works if the property has already been used so VFP can cache information concerning its existence.

With properties you know the data type of, you can use TYPE() to determine if they exist. For example:
oword = createobject('word.application')
? pemstatus(oword,'Name',5) && returns .F.
? type('oword.Name') = 'C' && returns .T.

? oword.Name && returns Microsoft Word

HTH.

>I am using a VFP DLL.
>
>In code, I create an instance of the DLL and set properties on it. Before
>I set the properties, I check to ensure each property is there. If the
>property is there, I assign a value to it:
>
>
>oDll = CREATEOBJECT("MyDll.MyClass")
>
>IF PEMSTATUS(oDll, "MyProperty", 5)
>  oDll.MyProperty="Some Text"
>ENDIF
>

>
>My problem is that PEMSTATUS() seems to return False even
>when a property exists. And the strange part is, it works fine if I run it
>as a class using SET CLASSLIB TO.
>
>So, is this by design (If so, why???), or is this a bug?
>
>Thanks
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform