Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CREATEOBJECTEX()
Message
From
02/08/2000 16:58:12
 
 
To
02/08/2000 15:19:31
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00400003
Message ID:
00400076
Views:
14
>Rec'd a DLL from a 3rd party that is supposed to allow me to pass parameters and invoke from my app as needed. I am learning, but as best as I can tell, I should be using CREATEOBJECTEX() with this as follows.
>
>x = createobjectex('{8E40A253-79F6-46FD-832B-05875A8CF669}','MARK_MCCLURE') && THE DLL FILE

Mark, CREATEOBJECTEX() requires a second parameter, being the target machine that will instance the out of process server for DCOM. The target machine must have the component registered on it an published as a startable DCOM server. CREATEOBJECTEX() then passes the CLSID to the target machine specified, and it goes through all the work of instancing the server, etc. The component has to be registered on the server, not on the client that issues CREATEOBJECTEX().

>with x
> .UserName = "MMCC"
> .ProjectorGlobal = "0613TST"
> .DataPath = "Q:\MDATA\OTHER\"
> .ReportFileName = "C:\ACTUALS\results.txt"
> .ImportFileName = "Q:\APPS\MPM\MPM_PCS_EST\0613.txt"
> .Autoburden = "N"
> .DuplicateActuals = "A"
>endwith
>

Relaize that paths will be resolved in the context of the remote server, so drive mappings won't necessarily match up (the Q: looks suspiciously like a mapped drive) and the server's local drive will be used for unmapped references (eg the server's C: drive, not the client's C: drive, will be used by the remote COM server.) If you need to pass around drive references, I'd very strongly recommend using UNCs...

>x.Process
>*********************************
>I get the "invalid class string" error as stated in the online help for attempting to use a progid without first registering the server on the local computer. But I have done that haven't I?? regsvr32 .dll Else I wouldn't have the class id number. It said it was successful when I did this registration of the dll. Or is it refering to my app as "the server"??
>
>Any help is appreciated.
>
>Mark
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