Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Datatypes types passed to COM servers
Message
De
05/03/1999 08:54:35
Gary Foster
Pointsource Consulting LLC
Chanhassen, Minnesota, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Titre:
Datatypes types passed to COM servers
Divers
Thread ID:
00194405
Message ID:
00194405
Vues:
46
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.
Répondre
Fil
Voir

Click here to load this message in the networking platform