错误指向了wincrypt.h里面:
#if(_WIN32_WINNT >= 0x0400)#ifdef __cplusplus
extern "C" {
#endif#ifndef _HRESULT_DEFINED
#define _HRESULT_DEFINED
typedef LONG HRESULT;错误:
error C2146: syntax error : missing ';' before identifier 'HRESULT'
fatal error C1004: unexpected end of file found

解决方案 »

  1.   

    当把定义放在对话框工程时没任何错误.
    我是控制台程序,包含有下列头文件:
    #define _WIN32_WINNT 0x0400
    #include <wincrypt.h>#include <winsock2.h>
    #include <map>
    using namespace std;
      

  2.   

    如果是自动生成的项目框架,应该是放在 stdafx.h 文件中。
      

  3.   

    #ifndef WINVER // 允许使用 Windows 95 和 Windows NT 4 或更高版本的特定功能。
    #define WINVER 0x0400 //为 Windows98 和 Windows 2000 及更新版本改变为适当的值。
    #endif#ifndef _WIN32_WINNT // 允许使用 Windows NT 4 或更高版本的特定功能。
    #define _WIN32_WINNT 0x0400 //为 Windows98 和 Windows 2000 及更新版本改变为适当的值。
    #endif
      

  4.   

    晕死,你的sdk版本太低了~~~~~~~~