Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Datatypes types passed to COM servers
Message
From
05/03/1999 08:54:35
Gary Foster
Pointsource Consulting LLC
Chanhassen, Minnesota, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Datatypes types passed to COM servers
Miscellaneous
Thread ID:
00194405
Message ID:
00194405
Views:
44
To All,
I posted this yesterday, but I don't see it so I'm posting this again.
I have an interesting situation. I need to send a SafeArray of VT_UI1 to a COM server by ref so it can fill the array with data.
I can create a string and convert it to a SafeArray with CreateBinary() but I can't send it by ref, only by val.
I can create an array and send it to the server by ref using COMARRAY(), but VFP sends it as an array of variants and the server chokes.
Am I missing something with these functions or am I simply out of luck? Examples below:

oServer = CreateObject('some.server')
DIMENSION aTest[15]
aTest = 'A'
COMARRAY(oServer,10) && Or 11, doesn't matter.
oServer.TryThis(aTest) && oServer gets VT_BSTR
oServer.TryThis(@aTest) && oServer gets VT_ARRAY|VT_VARIANT|VT_BYREF, close but no cigar!
COMARRAY(oServer,1) && Or 0, doesn't matter.
oServer.TryThis(@aTest) && oServer gets VT_ARRAY|VT_VARIANT

cString = 'ABCDEF'
aString = CreateBinary(cString)
oServer.TryThis(aString) && oServer gets VT_ARRAY|VT_UI1
oServer.TryThis(@aString) && oServer gets VT_ARRAY|VT_UI1, bummer!

oServer.TryThis(cString) && oServer gets VT_BSTR
oServer.TryThis(@cString) && oServer gets VT_BSTR|VT_BYREF

Ideal situation:
oServer.TryThis(@aTest) OR;
oServer.TryThis(@aString) OR;
oServer.TryThis(Something) would send VT_ARRAY|VT_UI1|VT_BYREF



Gary Foster
Pointsource Consulting Inc.
Reply
Map
View

Click here to load this message in the networking platform