Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VBA object passing to VFP Com server?
Message
 
 
To
17/08/2001 01:36:08
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00545154
Message ID:
00545205
Views:
11
>I deal with a proprietary program that uses VBA to supply macros. I use the macros to call on com servers I have written in VFP. I use objects in the proprietary program to return values to send as parameters to my servers. For example, I set cParameter1 = ds.GetValue('Vend_No'). Since I have more than one server and they each need different values, I have set up a VFP menu program that I invoke with the WSHShell run command inside a macro. (RUN Menu.exe cParameter1,cParamter2,...)
>
>I won't know what parameters will be needed until the user makes a selection. Then I need to know the value of ds.GetValue('Whatever'). So I would like to pass a reference to the ds object to my menu program (an exe) that could be passed on to the appropriate com server. (RUN Menu.exe DS)
>
>Does anybody know how this can be accomplished? I need to pass a VBA object reference to VFP as a command line parameter of an EXE inside a macro, or think of a different approach. Thanks.

Any parameter that VFP receives via the command line is treated as a character variable so no, you can't pass an object reference. You can't even use it to get the actual object (I don't think) because the object exists in an entirely different memory space.

This leaves "think of a different approach". < s >

Can the VBA code call your VFP COM servers directly? You could access the server and pass in all needed parameters to get the information you needed. This may entail changing the interface (PEMs) you have built for your COM servers but it would make them much more flexible.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform