Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Question concerning ActiveX functions that modify argume
Message
From
12/02/1999 15:56:34
 
 
To
12/02/1999 15:28:09
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00186821
Message ID:
00187174
Views:
22
>Thank you for your suggestion of using exposed properties to solve my problem. Unfortunately, exposing properties that would be accessed by FoxPro would result in too many calls to the server (the original function has 11 arguments) slowing things down considerably. I have attempted to send the information back to the FoxPro container through a custom event in the control but the fire event function never seems to get called. First, is this a reasonable way to approach the problem without exposing properties? Second, why is the fire event not being called on the FoxPro container even though I do "fire" the event on the ActiveX control side? Also, do you know if FoxPro6 allows for the modification of function arguments?

Unfortunately, there's no callback menchanism, so adding a new event to VFP isn't really supported. You might try exposing a collection and letting VFP pull the results back from the collection (IOW, pass values into the ActiveX control via parameters to the method, and have VFP examine the results through a set of member properties of the control after the method call completes. You can expand or shrink the size of result sets by expanding or removing the entries in a collection in your control, which VFP can spin through easilt with the FOR EACH construct.)

You may be able to use SafeArrays with VFP6 (you'll need to play around with the COMARRAY() function; COMARRAY can define array parameters as passed by reference, which would allow arrays to be altered and returned, but I've not played with altering the number of elements of an array passed by reference as parameters. That looks to be the most promising mechanism for your problem; I have not tried this myself.)

I would tend to avoid this, and use the OLE interface to expose results. In my own servers, I do not permit any parameters to pass by reference - anything that might be modified, or where the number of elements might be altered, must pass through the OLE interface, and only a single, simple result of know type is returned from any method call in my servers, normally a status. Works for me, but apparently is not an acceptable solution for you.

Ed
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
Reply
Map
View

Click here to load this message in the networking platform