Hello,
I want to use dll calls that use a type defined in a unit:
type
HCkHttp = Pointer;
function CkHttp_Create: HCkHttp; stdcall;
function CkHttp_Download(objHandle: CkHttp; url: PWideChar; localFilePath: PWideChar): Boolean; stdcall;
So i create declarations for use theese functions in my script:
function CkHttp_Create: Pointer; stdcall; external 'ChilkatDelphi3295089.dll';
function CkHttp_Download(objHandle: Pointer; url: PWideChar; localFilePath: PWideChar): Boolean; stdcall; external 'ChilkatDelphi3295089.dll';
As you can see, i need to declare the references to HCkHttp as a Pointer since i can't find a way to use / declare the HCkHttp type.
So my script code is like that (and work):
function CkHttp_Create: Pointer; stdcall; external 'ChilkatDelphi3295089.dll';
function CkHttp_Download(objHandle: Pointer; url: PWideChar; localFilePath: PWideChar): Boolean; stdcall; external 'ChilkatDelphi3295089.dll';
var
success: Boolean;
localfilepath: string;
http: Pointer; // instead of HCkHttp i would like to use
begin
http := CkHttp_Create();
success := CkHttp_Download(http,'https://someserver/delphi.zip',localFilePath);
if (success) then
begin
print('réussi !');
end
else
begin
print('raté');
Exit;
end;
ShowMessage('OK!');
end
but i want to replace Pointer by HCkHttp (because i want to import original declarations in a automatic mode and changing types are not a valid solution).
Thanks in advance for your help and i hoppe i've been understandable, if not request more informations. ;-)
I'm testing the Scripter to valid his use before buying a entreprise licence.
Best regards,