delphi调用vc中的dll参数如何对应?求救!!!!!!!!
vc中的函数为:
int connect_to(char *host,dpl_port_t port,conn_desc *conn);
在delphi怎么写参数?
我写的:
Tconnect_to=function(host:string;port:integer;conn:conn_desc):integer;
其中:conn_desc为结构类型
源程序:
procedure TForm1.Button1Click(Sender: TObject);
var
Handle: THandle;
fhz: integer;
connect_to:Tconnect_to;
conn:conn_desc;
begin
Handle := LoadLibrary('api.dll');
if Handle <> 0 then
begin
@connect_to:= GetProcAddress(Handle, 'connect_to');
fhz:= connect_to('192.168.0.91',1234,conn);
end;
FreeLibrary(Handle);
end;
vc中调用此函数正确,delphi中如何调用?????
我把host:string 改为host:pchar也不对,提示connect_to不足够实际参数;
fhz难接近的这里由于优化!!!!!!!