我在vc6.0中建立一个console类型的程序,定义如下变量
typedef WORD  aaa;
typedef struct
{
DWORD BBB;
int ccc;
} strtest;
编译后总出错::\console\stdafx.cpp(12) : error C2146: syntax error : missing ';' before identifier 'BBB'
h:\console\stdafx.cpp(12) : error C2501: 'DWORD' : missing storage-class or type specifiers
h:\console\stdafx.cpp(12) : error C2501: 'BBB' : missing storage-class or type specifiers
请问是否需要加入别的头文件?如何调试

解决方案 »

  1.   

    你没有包含DWORD的定义文件!在program FIles|Visual studio|...下|Find in files查就知道包含那个!
      

  2.   

    typedef unsigned long       DWORD;
      

  3.   

    加上windef.h后winnt.h又报错。
    c:\program files\microsoft visual studio\vc98\include\winnt.h(3143) : error C2146: syntax error : missing ';' before identifier 'ContextRecord'
    c:\program files\microsoft visual studio\vc98\include\winnt.h(3143) : error C2501: 'PCONTEXT' : missing storage-class or type specifiers
    c:\program files\microsoft visual studio\vc98\include\winnt.h(3143) : error C2501: 'ContextRecord' : missing storage-class or type specifiers
      

  4.   

    刚学完C++!学vc要电什么?
      

  5.   

    sorry,Console不支持,那你就自己把定义一下吧
    typedef unsigned long DWORD;
    typedef unsigned short int WORD;
    typedef WORD  aaa;
    typedef struct
    {
    DWORD BBB;
    int ccc;
    } strtest;
      

  6.   

    HANDLE这样的变量需要自定义吗?还是需要引用头文件?
      

  7.   

    你如果使用HANDLE的话,就应该使用Win32 Application创建应用程序了
      

  8.   

    你如果使用HANDLE的话,就应该使用Win32 Application创建应用程序了
      

  9.   

    console程序里面怎么会有HANDLE呢?HANDLE是WINDOWS编程里面才有的呀
      

  10.   

    改成Win32 Application创建应用程序后,程序还是报错
    HANDLE' : missing storage-class or type specifiers
      

  11.   

    类似这种自定义类型的变量如typedef TIMEDATE DBID;都找不到原始的类型,如何解决这种问题?