调用了一个c 写的 dll ,dll 是没有错的,很简单。
调试器报的错(就是那种跳出调试器):
dephi.exe faulted with message:'access viloation at 0x004050941:
write of address 0xx.... ',Process stopped.Use Step or Run to continue.调用方法:
function Pack(pPackFileName,pSourceName,Lm_size: PChar) : Boolean; stdcall; external 'PackFiles.dll';Pack(PChar(Trim(edFileName.Text)),PChar(Trim(edPath.Text)),'2');
调试器报的错(就是那种跳出调试器):
dephi.exe faulted with message:'access viloation at 0x004050941:
write of address 0xx.... ',Process stopped.Use Step or Run to continue.调用方法:
function Pack(pPackFileName,pSourceName,Lm_size: PChar) : Boolean; stdcall; external 'PackFiles.dll';Pack(PChar(Trim(edFileName.Text)),PChar(Trim(edPath.Text)),'2');
没明白 use c code's the dll,must use .def file,
上面方法不行吗?
function Pack(pPackFileName,pSourceName,Lm_size: PChar) : Boolean; stdcall; external 'PackFiles.dll';
是在 unit GlobalUnit; 中定义的。
点击 退出按钮,MainForm.Close();
Project FilePack.exe raised exception class EInvalidPointer
with message 'Invalid pointer operation stopped.Use Step or
Run to continue.