Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
COM communications
Message
From
25/02/1999 15:21:23
 
 
To
25/02/1999 14:58:29
Gary Foster
Pointsource Consulting LLC
Chanhassen, Minnesota, United States
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00191595
Message ID:
00191603
Views:
19
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform