Thanks for the info, however
The part that confuses me is the passing of the pointer to the structure
as an integer.
I have tried
var
pm : pointer;
begin
pm := @replyHdr;
hOk := myOb.GetReplyBufferDirect( sizeof(replyHdr) , integer(pm),
bOK);
end;
I get violations etc,
> -----Original Message-----
> From: Struan Judd [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, January 28, 1999 9:22 AM
> To: Multiple recipients of list delphi
> Subject: RE: [DUG]: Help with C to Pascal translation and COM
> interface
>
> 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
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz