Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameter not passed
Message
From
22/04/2002 15:16:14
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00647770
Message ID:
00647784
Views:
8
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform