>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...