我在书上看到了这两种类型,可是我在程序中定义了这两种类型的变量:
定义如下:
interfaceuses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls;type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Shape1: TShape;
    Shape2: TShape;
    Shape4: TShape;
    Shape3: TShape;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Timer1: TTimer;
    procedure Button1Click(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure DetectEvent();
  private
    { Private declarations }
  public
     hComm:THandle;
    { Public declarations }  end;var
  Form1: TForm1;
  Comm1:TComm;
  wEvent:Tevent;
implementation可程序运行调试时却出错了,出错信息如下:
[Error] Unit1.pas(35): Undeclared identifier: 'TComm'
[Error] Unit1.pas(36): Undeclared identifier: 'Tevent'
[Error] Unit1.pas(85): Undeclared identifier: 'TWaitResult'
[Error] Unit1.pas(88): Missing operator or semicolon
[Error] Unit1.pas(88): Too many actual parameters
[Error] Unit1.pas(88): Too many actual parameters
[Fatal Error] Project2.dpr(5): Could not compile used unit 'Unit1.pas'请大家帮我看看这是怎么回事?

解决方案 »

  1.   

    Comm1:TComm;
     wEvent:Tevent;
    找不到这样的类型,可能是他自己定义的类型
      

  2.   

    这可能是别人自己定义的数据类型!你要把他的unit uses进来才可以的!
      

  3.   

    就是,你需要找到声明 TComm 和TEvent 的单元文件,在你的interface 的 Uses 部分加入引用。
      

  4.   

    可是那书说却说这是Delphi自带的类啊!
      

  5.   

    TEvent 在 unit SyncObjs 中
      

  6.   

    youcheng1(晓松):以T开头不一定是类,如TRECT