Basetsd.h文件的问题,在MSDN中解释如下:
这个Basetsd.h在什么目录下呀??SYMPTOMS
When you compile an application that uses the Sqloledb.h header file from the Microsoft Platform Software Development Kit (SDK), you receive the following error: error C2146: syntax error : missing ';' before identifier 'HACCESSOR' 
CAUSE
The compiler is unable to find the definition of the ULONG_PTR data type. This data type is defined in the Basetsd.h header file that is included with the Platform SDK but is not defined in the version of the Basetsd.h file that is installed with Microsoft Visual C++. RESOLUTION
In the Visual C++ settings, the Include directory for the Platform SDK must be above the Include directory for Visual C++ in the search list.From the Tools menu, click Options and click the Directories tab. In the Show Directories for combo box, click Include files. Make sure that the Platform SDK\Include directory is at the top of the list; this forces the compiler to use the Basetsd.h file from the Platform SDK. 

解决方案 »

  1.   

    http://dev.csdn.net/Develop/article/13/13917.shtm
      

  2.   

    要把sdk的头文件路径写在前面
    这个问题经常遇到,是头文件顺序问题.
    tools,option,directions,include files
      

  3.   

    就是说在VC++环境下一般不会出现这个问题,但是一定保证Basetsd.h
    放在系统默认的包含路径下
      

  4.   

    楼上怎么尽误导楼主啊~!
    不是没有Basetsd.h这个文件,而是vc++和sdk都有这个文件,vc++里面的这个文件没有定义ULONG_PTR 结构,所以必须把sdk的路径放在vc++的前面,确保搜索的时候找到的是sdk的,而不是vc++的