首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

capgetdriverdescription未声明?解决办法

2012-12-20 
capgetdriverdescription未声明??!!程序如下,VFW.PAS已经添加unit VideoCapDriversinterfaceusesWindows,

capgetdriverdescription未声明??!!
程序如下,VFW.PAS已经添加

unit VideoCapDrivers;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    ComboBox1: TComboBox;
    Label1: TLabel;
    Label2: TLabel;
    StaticText1: TStaticText;
    Label3: TLabel;
    StaticText2: TStaticText;
    Label4: TLabel;
    StaticText3: TStaticText;
    procedure FormCreate(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;
 StaticText3.Caption:=inttostr(DrvCount);
end;

end.

错误报告:
[Error] VideoCapDrivers.pas(43): Undeclared identifier: 'capGetDriverDescription' 

请问怎么会有这样的错误呢?如何解决?
[解决办法]
var
  Form1: TForm1;

implementation
 uses vfw;

{$R *.dfm}

注:在此处添加 uses vfw;
虽然你工程中添加了vfw.pas,但你在此单元中未引用vfw.pas,所以未能解capGetDriverDescription函数
[解决办法]
对呀,最好没忘记引用相关的“单元”

热点排行