Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
COM comments
Message
From
06/04/1998 12:11:40
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
06/04/1998 12:02:46
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Miscellaneous
Thread ID:
00089812
Message ID:
00089861
Views:
30
>>>I've been working on COM and Automation with a new project. Essentially I have a database server which receives information from several different communication components, processes the information against the Database, and returns ACK to the communication server. I have one communication server written in VC++ and another written in VFP. Both work, both allow communication between components BUT...
>>>
>>>I start the application up by initiating the communication service. It creates an instance of the VFP database server and registers with the database server. At registration, the database server knows what communication server is instantiating it and executes a GETOBJECT() call to get a reference to the communication service. Since the communication service is already running, I do not want to create a new instance of it, I simply want to get a reference to the running object. Here's the problem. If the running communication server is the one written in VC++ the syntax used for GETOBJECT() is:
>>>
>>>oComServer = GETOBJECT(,lcAppName)
>>>
>>>where the syntax used if the communication server is a VFP app is:
>>>
>>>oComServer = GETOBJECT("", lcAppName)
>>>
>>>If I use the second syntax with a VC++ app it creates another instance of the communication server. If I use the first syntax with the VFP communication server it gives me an OLE error.
>>>
>>>This stuff is not terribly well documented. Any ideas?
>>>
>>>Rick Grinter
>>Rick,
>>VFP strings are not ASCIIZ so could you try it with GETOBJECT(chr(0), lcAppName).
>>Cetin
>
>Cetin:
>
>Thanks for the prompt reply. I tried the CHR(0) but that didn't work with either the VFP or VC++ server.
>
>Rick
Then Rick,
I'm afraid you would need access to VFP server's source. In init (or wherever the parms pass) do a check for type of first parm and set to "" if logical. This way you could use VC syntax for both.
oComServer = GETOBJECT(,lcAppName)
? partest(,"there")
? partest("hello","there")

function partest
lparameters v1,v2
if type("v1") = "C"
 ? v1,v2
else
 ? v2
endif
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform