Neil,

As I read it, they are passing a pointer to the replyHdr structure into
the GetReplyBufferDirect routine along with the size of the replyHdr
structure (reply_hdr_def).

I think you will find that there are a number of possible structures and
the exact type of the structure is encoded in the first few fields of
the structure that is common across them all.

Find the definition of reply_hdr_def, encode this as a Delphi record
(carefully now) and then consider using this as the type of the var
parameter.

Have fun.

TTFN.
----
Struan Judd     <*>             EMail:          [EMAIL PROTECTED]
CJN Technologies Ltd            Phone:          +64 (9) 415 4796
All opinions mine only  Mobile: +64 (21) 685 335


-----Original Message-----
From: Neil Anderson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 28 January 1999 08:58
To: Multiple recipients of list delphi
Subject: [DUG]: Help with C to Pascal translation and COM interface


Hello

I am using some 3rdparty COM objects and would like some using the
following methods,

I have imported the type library :

  IDirectBufferAccess = interface
    ['{F080A41A-28E0-11D2-80B6-00A0C92296F1}']
    function SetRequestBufferDirect(ReqBufferLen: Integer; var
ReqBuffer: Integer; 
                                    var Success: WordBool): HResult;
stdcall;
    function GetReplyBufferDirect(RepBufferLen: Integer; var RepBuffer:
Integer; 
                                  var Success: WordBool): HResult;
stdcall;
  end;

The example using the method in C++  is

        hResult = m_pAddContactDirectBuffer->GetReplyBufferDirect(
                        sizeof(reply_hdr_def), (long*)&replyHdr,
&vt_success);

I am not sure what (long*)&replyHdr is doing. I think they are passing
the address of the buffer.
The imported type lib declared as integer (var ReqBuffer: Integer).

Could someone who understands C++ please help ?

Neil

------------------------------------------------------------------------
---
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to