capgetdriverdescription的问题
我在编写下端程序时,N多函数都说我未定义。。。。包括capgetdriverdescription等等,那位大侠指点指点一二啊
程序:
unit VideoCapDrivers;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
StaticText1: TStaticText;
StaticText2: TStaticText;
StaticText3: TStaticText;
ComboBox1: TComboBox;
procedure FormCreate(Sender: TObject);
procedure ComboBox1Change(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
var
wDriverIndex : DWORD;
Drvcount : Integer;
DrvName : array[0..80] of char;
DrvVer : array[0..80] of char;
begin
DrvCount:=0;
for wDriverIndex:=0 to 9 do
if capGetDriverDescription(
wDriverIndex,
DrvName,sizeof(DrvName),
DrvVer,sizeof(DrvName))then
begin
inc(DrvCount);
end;
DriverCountText.Caption:=inttostr(DrvCount);
end;
procedure TForm1.ComboBox1Change(Sender: TObject);
wDriverIndex : DWORD;
DrvName : array[0..80] of char;
DrvVer : array[0..80] of char;
errmsg : string;
begin
wDriverIndex:=DriverIndexComboBox.ItemIndex;
if capGetDriverDescription(
wDriverIndex,
DrvName,sizeof(DrvName),
DrvVer,sizeof(DrvName))then
begin
DriverNameText.Caption:=DrvName;
DriverVersionText.Caption:=DrvVer;
end
else
begin
DriverNameText.Caption:='';
DriverVersionText.Caption:='';
Beep;
errmsg:='Error:Driver Index='+inttostr(wDriverIndex)+'你的计算机上无此设备';
ShowMessage(errmsg);
end;
end;
end.
报告
[Error] VideoCapDrivers.pas(43): Undeclared identifier: 'capGetDriverDescription'
[Error] VideoCapDrivers.pas(50): Undeclared identifier: 'DriverCountText'
[Error] VideoCapDrivers.pas(50): Missing operator or semicolon
[Error] VideoCapDrivers.pas(54): Unknown directive: 'wDriverIndex'
[Error] VideoCapDrivers.pas(54): Declaration expected but ':' found
[Error] VideoCapDrivers.pas(59): Undeclared identifier: 'wDriverIndex'
[Error] VideoCapDrivers.pas(59): Undeclared identifier: 'DriverIndexComboBox'
[Error] VideoCapDrivers.pas(59): Missing operator or semicolon
[Error] VideoCapDrivers.pas(60): Undeclared identifier: 'capGetDriverDescription'
[Error] VideoCapDrivers.pas(62): Undeclared identifier: 'DrvName'
[Error] VideoCapDrivers.pas(63): Undeclared identifier: 'DrvVer'
[Error] VideoCapDrivers.pas(65): Undeclared identifier: 'DriverNameText'
[Error] VideoCapDrivers.pas(65): Missing operator or semicolon
[Error] VideoCapDrivers.pas(66): Undeclared identifier: 'DriverVersionText'
[Error] VideoCapDrivers.pas(66): Missing operator or semicolon
[Error] VideoCapDrivers.pas(70): Missing operator or semicolon
[Error] VideoCapDrivers.pas(71): Missing operator or semicolon
[Error] VideoCapDrivers.pas(73): Undeclared identifier: 'errmsg'
[Fatal Error] Project1.dpr(6): Could not compile used unit 'VideoCapDrivers.pas'
[解决办法]
代码不少 关注中。。。
-------------------------------------
xule即时通讯软件,可定制的P2P即时通信系统为各行业门户网站和企事业单位打造一个稳定,安全,高效,可扩展的即时通信系统,类似QQ、贸易通和淘宝旺旺(可提供技术资料和源码)
介绍:http://www.xulesoft.cn
QQ:1196435261
[解决办法]
使用api函数要先声明,vb是这样要求的
delphi也应该如此吧
[解决办法]
capgetdriverdescription 是vfw里面的函数,Use Vfw32.lib需要用的库