Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parameter not passed
Message
De
22/04/2002 15:16:14
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00647770
Message ID:
00647784
Vues:
9
>Hi everybody,
>
>I have a COM server with a LPARAMETERS in the INIT event :
>
>Define Class MyClass As Custom Olepublic
>SomeProperty = ""
>
>Function Init
>LParameters p_MyParameter
>
>If PCount() = 1
> This.SomeProperty = p_MyParameter
>Else
> This.SomeProperty = "No parameter"
>EndIf
>
>EndFunc
>
>EndDefine
>
>I compile this project as a DLL COM server....

You can't pass parameters to a VFP COM object during Init. You have to make a subsequent call to set the property.

>
>In another application, I use the following syntax :
>
>OInstance = CreateObject("MyComServerProject.MyClass","Parameter passed")
>MessageBox(OInstance.SomeProperty)
>
>The MessageBox always displays "No parameter"...
>
>Any idea why ????
>
>Thanks in davance...
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform