DLL的問題,好心的大俠,進來看一下 ( 积分: 50 )

  • 主题发起人 主题发起人 houfuzhu1982
  • 开始时间 开始时间
H

houfuzhu1982

Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button1Click(Sender: TObject);
var FunH,capWinH:THandle;
capCreateCaptureWindow:function(lpszWindowName:PChar;
dsStyle:DWORD;
x,y:Integer;
nWidth,nHeight:Integer;
hwndParent:THandle;
nId:Integer):THandle;

begin

FunH:=LoadLibrary('C:/WINDOWS/system32/avicap32.dll');
try
if FunH<>0 then

begin

@capCreateCaptureWindow :=GetProcAddress(FunH,'capCreateCaptureWindow');
if @capCreateCaptureWindow<>nil then

begin


end;

end;

finally
FreeLibrary(FunH);
end;

end;


@capCreateCaptureWindow這個值查看到的是Nil,怎麼回事,avicap32.dll應該是有這個函數的啊,大俠,指點一下啊,小蝦我拜謝了
 
你应该用
@capCreateCaptureWindow :=GetProcAddress(FunH,'capCreateCaptureWindowA');
或者
@capCreateCaptureWindow :=GetProcAddress(FunH,'capCreateCaptureWindowW');

avicap32.dll中函数如下:
AppCleanup
capCreateCaptureWindowA
capCreateCaptureWindowW
capGetDriverDescriptionA
capGetDriverDescriptionW
videoThunk32
 
大俠,路過了,就踩兩下吧!

同情一下我這顆對Delphi赤誠的心吧[:)]
 
大蝦,太感謝。
我會記得你的
 
procedure TForm1.Button1Click(Sender: TObject);
var FunH,capWinH:THandle;
capCreateCaptureWindow:function(lpszWindowName:PChar;
dsStyle:DWORD;
x,y:Integer;
nWidth,nHeight:Integer;
hwndParent:THandle;
nId:Integer):THandle;
begin

//请注意:2000系统是'C:/WINNT/system32/avicap32.dll'
//XP系统是'C:/WINDOWS/system32/avicap32.dll'
FunH:=LoadLibrary('C:/WINNT/system32/avicap32.dll');
try
if FunH<>0 then

begin

@capCreateCaptureWindow :=GetProcAddress(FunH,'capCreateCaptureWindowA');
if @capCreateCaptureWindow<>nil then

begin

ShowMessage('a');
end;

end;

finally
FreeLibrary(FunH);
end;

end;
//测试成功。
 
后退
顶部