再请教,vc的动态库函数,在delphi下如何声明?(200)

K

keynexy

Unregistered / Unconfirmed
GUEST, unregistred user!
vc源函数说明如下://(34) open an existed file on private area, return a handle when success,//#define PFILE_OPEN 0x01 ---- mode//#define PFILE_CREATE 0x02 ---- mode// mode ---in --- file open mode , PFILE_OPEN (when file is existed),// PFILE_CREATE (when file is not existed)// handle --- out ---this function will return a handle when file open success// filename --- in ---file name to openULONG PA_FileOpen(UCHAR mode, ULONG &handle, char* fileName);
 
D

de410

Unregistered / Unconfirmed
GUEST, unregistred user!
参考http://topic.csdn.net/t/20041130/18/3602936.htmlhttp://blog.csdn.net/zhuqinglu/archive/2008/08/22/2816288.aspx
 
K

keynexy

Unregistered / Unconfirmed
GUEST, unregistred user!
再请教:为什么我在调用的时候,handle返回总是0? 以下是我的源码, 声明: PA_FileOpen=function(mode:byte;out handle:THandle;const fileName:pansichar):Cardinal;cdecl;
调用: procedure TForm1.btnClick(Sender:TObject);
var PFunc:TFarProc;
bn:cardinal;
h:Thandle;
begin
PFunc:=GetProcAddress(Udll,'PA_FileOpen');
if PFunc <>nil then
begin
bn:=PA_FileOpen(PFunc)(2,h,'111.txt');
if bn <>0 then
raise exception.Create('文件创建失败!!') else
showmessage(inttostr(h));
end else
showmessage('不能找到函数入口!');
end;
 

草原骏马

Unregistered / Unconfirmed
GUEST, unregistred user!
试试这个:PA_FileOpen=function(mode:byte;var handle:THandle;const fileName:pansichar):Cardinal;cdecl;
 
K

keynexy

Unregistered / Unconfirmed
GUEST, unregistred user!
var,out都试了,handle返回总是0
 

地质灾害

Unregistered / Unconfirmed
GUEST, unregistred user!
DLL本身问题。
 
W

wql

Unregistered / Unconfirmed
GUEST, unregistred user!
PA_FileOpen=function(mode:byte;var handle:DWord;fileName:pchar):DWord;stdcall;
 
K

keynexy

Unregistered / Unconfirmed
GUEST, unregistred user!
感谢大家的参与,虽然至今没有解决问题
 

Similar threads

Top Bottom