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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only