B
beyzhzj
Unregistered / Unconfirmed
GUEST, unregistred user!
我把res文件做在dll中,如何動態的從dll中存取avi?
var
dllHandle,resHandle,TmpHandle:THandle;
HRes: THandle;
ResourceChar;
begin
dllHandle := LoadLibrary(PChar('Resource.dll'));//Resource.dll已經存在
resHandle:=FindResourceHInstance(dllHandle);
if resHandle> 0 then
begin
try
HRes:=FindResource(resHandle,PChar('waitavi'),'AVI');
if HRes>0 then
TmpHandle:= LoadResource(resHandle, HRes);
if TmpHandle>32 then
Resource:= LockResource(TmpHandle);
animate1.Resname:=Resource; //這一步有錯,但我不知道為甚麼?
except
showmessage('Error');
exit;
end;
end;
if Animate1.Active=False then
Animate1.Active:=True;
var
dllHandle,resHandle,TmpHandle:THandle;
HRes: THandle;
ResourceChar;
begin
dllHandle := LoadLibrary(PChar('Resource.dll'));//Resource.dll已經存在
resHandle:=FindResourceHInstance(dllHandle);
if resHandle> 0 then
begin
try
HRes:=FindResource(resHandle,PChar('waitavi'),'AVI');
if HRes>0 then
TmpHandle:= LoadResource(resHandle, HRes);
if TmpHandle>32 then
Resource:= LockResource(TmpHandle);
animate1.Resname:=Resource; //這一步有錯,但我不知道為甚麼?
except
showmessage('Error');
exit;
end;
end;
if Animate1.Active=False then
Animate1.Active:=True;