Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
COM Array problems
Message
From
04/03/1999 17:44:09
Gary Foster
Pointsource Consulting LLC
Chanhassen, Minnesota, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
COM Array problems
Miscellaneous
Thread ID:
00194245
Message ID:
00194245
Views:
44
To All,
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

Any suggestions?

Gary Foster
Pointsource Consulting Inc.
Reply
Map
View

Click here to load this message in the networking platform