vc++调用delphi做的DLL问题(100分)

F

fox_s

Unregistered / Unconfirmed
GUEST, unregistred user!
void Init(HWND pWnd)
初始化相关系统,pWnd为返回消息的句柄,这是项目的要求,
我要用delphi做个DLL满足这个要求
在delphi里我觉得应该写成
procedure Init(pWnd:thandle)export;
cdecl;
但是这个函数内容应该怎么写呢,怎么处理thandle这个变量呢
 
pWnd:thandle 能不能 pWnd:integer 啊
 
HWND应该是个句柄变量,pWnd:integer对应不上吧
 
再问个问题,BOOL GetWsCount(long &ldeep);
在vc++里如何调用这个函数,如何得到ldeep的值
 
procedure Init(var pWnd:THandle)export;
cdecl;
begin
Result:=Application.Handle;
Result:=Self.Handle;
Result:=Integer(Self);
//......等等
end;

VC调用其它语言写的DLL,只能采用动态调函
LoadLibrary
GetProcAddress
FreeLibrary
 
procedure Init(var pWnd:THandle)export;
cdecl;
begin
Result:=Application.Handle;
Result:=Self.Handle;
Result:=Integer(Self);
//......等等
end;
好像不对吧?
 
nnscccn
那怎么才对啊,请指教
 
nnscccn所说的不对应该是:
procedure Init(var pWnd:THandle)export;
cdecl;
begin
Result:=Application.Handle;
Result:=Self.Handle;
Result:=Integer(Self);
//......等等
end;
上面是一个过程,不能使用"Result"
正确的应该是:
procedure Init(var pWnd:THandle)export;
cdecl;
begin
pWnd:=Application.Handle;
pWnd:=Self.Handle;
pWnd:=Integer(Self);
//......等等
end;
 
我用delphi做的DLL其中一个函数function Ggg(var a:pchar):bool;export;
cdecl;
在vc中如何调用void Ggg(char * x);来取得所传参数呢? lzylogic知道吗,我的qq是2306205欢迎交流
 
char aa;
Ggg(&aa);
或者
char aa[100];
Ggg(aa);
 
接受答案了.
 
顶部