我在编写下端程序时,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'