本帖最后由 oyljerry 于 2012-01-19 11:11:23 编辑

解决方案 »

  1.   

    stdafx.h
    里加一句
    #define _WIN32_WINNT 0x0600 
    试下.
      

  2.   

    http://ycwangshuai2008.blog.163.com/blog/static/506693312009915105632568/
      

  3.   

    fatal error C1189: #error : Your version of the Windows SDK is earlier than 6.0. Try setting the 'WINVER' and '_WIN32_WINNT' definitions in your project to less than 0x0600.============
    翻译下,致命错误C1189:#error发出的错误:你的SDK版本早于6.0,试着将WINVER和_WIN32_WINNT在你的工程中定义成小于0x0600的数
    ============
    由于VS2008集成了SDK,但是你的版本比较老,所以会有这样的错误。
    解决办法是,在你的stdafx.h里面,添加下面两句(我估计你的事XP)#define WINVER 0x0501
    #define _WIN32_WINNT 0x0501
      

  4.   


    stdafx.h头部中添加#ifndef WINVER                  // Specifies that the minimum required platform is Windows Vista. #define WINVER 0x0500          // Win2k #endif #ifndef _WIN32_WINNT            // Specifies that the minimum required platform is Windows Vista. #define _WIN32_WINNT 0x0500    // Win2k #endif加了也没有用。。依然提示#pragma once#ifndef _SECURE_ATL
    #define _SECURE_ATL 1
    #endif#ifndef VC_EXTRALEAN
    #define VC_EXTRALEAN            // 从 Windows 头中排除极少使用的资料
    #endif#include "targetver.h"#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS      // 某些 CString 构造函数将是显式的#ifndef WINVER                  // Specifies that the minimum required platform is Windows Vista. 
    #define WINVER 0x0500          // Win2k 
    #endif #ifndef _WIN32_WINNT            // Specifies that the minimum required platform is Windows Vista. 
    #define _WIN32_WINNT 0x0500    // Win2k 
    #endif// 关闭 MFC 对某些常见但经常可放心忽略的警告消息的隐藏
    #define _AFX_ALL_WARNINGS
    //#define _BIND_TO_CURRENT_VCLIBS_VERSION
    #include <afxwin.h>         // MFC 核心组件和标准组件
    #include <afxext.h>         // MFC 扩展
    #include <afxdisp.h>        // MFC 自动化类之前一直用没有问题,不记得该什么东东了。。
      

  5.   

    VS2008了,就应该用比较新的SDK,比如Windows7 SDK
      

  6.   


    加了之后就出现这个错误了。program files\microsoft sdks\windows\v6.0a\include\transact.h(293) : error C2061: syntax error : identifier '__RPC__in_opt'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\transact.h(298) : error C2061: syntax error : identifier '__RPC__out'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\transact.h(395) : error C2061: syntax error : identifier '__RPC__deref_out_opt'
    1>c:\program files\microsoft sdks\windows\v6.0a\include\transact.h(500) : error C2061: syntax error : identifier '__RPC__out'
      

  7.   

    你是否中间尝试安装过其他版本的vs,比如vc6或2010.
    没试过干脆重新安装windows sdk7.0然后调试。