procedure dlltest;
var
libhandle : THandle ;
begin
libhandle := LoadLibrary('test.dll');
Freelibrary(libhandle);
end;程序报如下错:
raised too many consecutive exceptions :'
access violation at 0x00000000
read of address 0x00000000'
var
libhandle : THandle ;
begin
libhandle := LoadLibrary('test.dll');
Freelibrary(libhandle);
end;程序报如下错:
raised too many consecutive exceptions :'
access violation at 0x00000000
read of address 0x00000000'
如果是这样你要看看动态库中的方法有没有导出。
看提示信息 为0地址呀 这是不能访问的
你应该
procedure dlltest;
var
libhandle : THandle ;
begin
libhandle := LoadLibrary('test.dll');
if libhandle <> 0 then
begin
Freelibrary(libhandle);
end;
end;
1. 学会看提示信息
2. 要安全性的编程
......
var
libhandle : THandle ;
begin
libhandle := LoadLibrary('test.dll');
if libhandle <> 0 then
begin
try
Freelibrary(libhandle);
except
ShowMessage(IntToStr(GetLastError())); // 看看错误代码是多少。。
end;
end;
end;
在调用string参数的时候需要特别加一个单元,请查找一下
程序崩了,执行不到except段,就难在这里啊 richard_ouyang(爱象刀上的苹果)
所有单元都加了