Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
COM communications
Message
De
25/02/1999 15:21:23
 
 
À
25/02/1999 14:58:29
Gary Foster
Pointsource Consulting LLC
Chanhassen, Minnesota, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00191595
Message ID:
00191603
Vues:
20
>Hi,
>I need to communicate with a third party COM server for transfering data. One of the methods I must call requires me to pass two pointers to byte arrays that the server will fill with data, e.g., ReadNoahData(nKey,nType, ByteArrayPointer1,ByteArrayPointer2). I can't figure it out. COMARRAY() and/or CREATEBINARY() don't seem to help. Anybody ever done this? Thanks.
>

You probably need to allocate buffers at known locations and pass a pointer to them. If this is the case, CLSHEAP can help, since it allocates buffers and returns pointers. I haven't tried this, but give CLSHEAP a try; your code might look something like:


SET PROCEDURE TO CLSHEAP
oHeap = CREATEOBJ('HEAP')
nPointer1 = oHeap.Alloc(nSizeOfBufferToPassAsPointer1)
nPointer2 = oHeap.Alloc(nSizeOfBufferToPassAsPointer2)
* do whatever else you need to do
* pass nPointer1 as the first buffer, nPointer2 as second buffer
* on return, you can get the content of the buffers back via
cStringBuffer1 = oHeap.CopyFrom(nPointer1)
cStringBuffer2 = oHeap.CopyFrom(nPointer2)

I haven't read the doc on the COM object, so I'm not sure exactly what data type is expected for the COM object (you might want to examine the interface using VB's Object Browser, or the C++ OLE COM Object Viewer, but it's fairly safe to try, even if it doesn't work...
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform