Board index » delphi » How do i convert a

How do i convert a


2006-10-03 09:04:52 PM
delphi55
function defined in the Type library in C++
ClientInitialize([in] WCHAR *pwcUsercode,
[in] WCHAR *pwcPassword,
[in] WCHAR *pwcDomain,
[in] WCHAR *pwcServerIdent,
[in] UINT uiAuthType,
[out] byte **ppbInitialRequest,
[out] UINT *uiOutputLength);
After importing the type library to Delphi it looks like
procedure ClientInitialize(var pwcUsercode: WideString; var
pwcPassword: WideString; var pwcDomain: WideString; var pwcServerIdent:
WideString; uiAuthType: Longword;
out ppbInitialRequest: PByte1; out uiOutputLength: Longword);
i implemented the procedure as
function THostPipe.GetSecurityOption : Integer;
var
ClientAuth : TClientAuth;
ClientInt : IClientAuth;
ppbInitialRequest : PByte1;
uiOutputLength : LongWord;
pwcUsercode, pwcPassword, pwcDomain, pwcServerIdent : WideString;
begin
pwcServerIdent := '';
pwcUsercode := fUserCodeBuffer ;
pwcPassword := fPasswordAsIs;
pwcDomain := HostName;
ppbInitialRequest := Nil;
uiOutputLength := 0;
ClientInt := CoClientAuth.Create;
ClientInt.Debug := 0;
ClientAuth := TClientAuth.Create(Nil);
try
ClientAuth.ClientInitialize(pwcUsercode,
pwcPassword,
pwcDomain,
pwcServerIdent,
AUTHTYPE_NTLM,
ppbInitialRequest,
uiOutputLength);
except
On E : Exception do
ShowMessage(E.Message);
end;
Result := 0;
end;
I get access violation at run time. I believe there is some problem
while passing the output parameter ppbInitialRequest. Its a pointer -
pointer in C++ where as it is PBYTE1 in Delphi.
Please give me a solution to this problem. I badly need it.
Thanks
Anant
 
 

Re:How do i convert a

Hoi Anant
This newsgroup officially closed years ago. You need to repost your message
in the b.p.delphi.language.delphi.general newsgroup and do so using the
Borland news server, if you want people to see it.
How to post to Delphi newsgroups:
<delphi.wikia.com/wiki/Delphi_Newsgroups>