Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
PEMSTATUS() In a DLL
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00595837
Message ID:
00596133
Vues:
30
Kevin,
Pemstatus does not work on COM objects. When you create an object outside of the DLL and then assign it to a property of the DLL, the object is sent through the COM barrier and transformed. Because the object reference oDLL.oForm is now a COM object and not a native VFP object, Pemstatus fails.

Suggestions
1. Find a way to have the DLL instantiate the object and assign it to the oForm property itself. Outside of the DLL, it will be a COM object while any code executed inside the DLL will treat it as a native object.
2. Error trap the call to MyMethod. If it doesn't exist, disregard it. If it does, continue processing.

HTH.

>I created a dll with a property, 'oForm'. I assigned it as follows:
>
>
>oForm = newobject("MyForm", "MyClassLib")
>oDLL = createobject("mydll.myclass")
>
>oDll.oForm = oForm
>

>
>Inside the DLL I have:
>
>IF PEMSTATUS(This.oForm, "MyMethod", 5)
>

>
>
>If I run this as a class, it works fine. PEMSTATUS finds the method.
>But when I build the DLL, PEMSTATUS fails to find the method. Is this
>by design? If so, how do I determine if a method exists on 'oForm'?
>Thanks
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform