错误 1 error C1189: #error :  atlddx.h requires atlapp.h to be included first
这个怎么解决?

解决方案 »

  1.   

    你的头文件引用顺序是怎样的?从错误提示来看,应该是atlapp.h没有include。
      

  2.   

    stdafx.h// Change these values to use different versions
    #define WINVER 0x0500
    //#define WINVER 0x0400
    //#define _WIN32_WINNT 0x0400
    #define _WIN32_IE 0x0500
    #define _RICHEDIT_VER 0x0100#include <atlbase.h>
    #include <atlcoll.h>
    #include <atlstr.h>#include <atlwin.h>
    #include <atlddx.h>
    #include <atltypes.h>#include <atlapp.h>extern CAppModule _Module;#include <atlsplit.h>
    #include <atlgdi.h>
    #include <atlctrls.h>
    #include <atlctrlx.h>
    #include <atlctrlw.h>就是dockpanel demo http://www.codeproject.com/Articles/5788/Tab-Controls-And-Splitters-Adding-Some-Dockable-An编译不过
      

  3.   

    把这个#include <atlapp.h>放到#include <atlbase.h>后面
    error C1189: #error :  atlddx.h requires atlapp.h to be included first 
    atlddx.h之前需要先引用atlapp.h
      

  4.   

    atlddx.h requires atlapp.h to be included first 
    别跟我说这句话你不明白。你可以去google翻译啊。
      

  5.   


    大哥,你贴出来的头文件引用顺序
    #include <atlapp.h>在#include <atlddx.h>后面
    你说这个error信息里的included first应该咋理解?
    你再看几个WTL里带的例子,#include <atlapp.h>跟在谁后面...
      

  6.   

    #ifndef __ATLDDX_H__
    #define __ATLDDX_H__#pragma once#ifndef __ATLAPP_H__
    #error atlddx.h requires atlapp.h to be included first
    #endif#include <atlbase.h>
    #include <atlapp.h>
    #include <atlddx.h>
      

  7.   

    哎...看了下代码,估计那时候作者写这份代码时,WTL不是现在这样,所以stdafx.h里的引用顺序用最新的WTL 8.1可能就有问题了。
    你就调整下stdafx.h里的引用顺序就行了,不用去改WTL 8.1的头文件
    #include <atlbase.h>
    #include <atlapp.h>  //位置换到这里来
    #include <atlcoll.h>
    #include <atlstr.h>
     
    #include <atlwin.h>
    #include <atlddx.h>
    #include <atltypes.h>
     
    //#include <atlapp.h> //位置换上去
      

  8.   

    资源我已经上传到csdn了,http://download.csdn.net/detail/nevermorewish/4748803
      

  9.   

    注意看WTL的ReadMe文档,其中有个头文件封装了基础类型,包括CString
    atlmisc.h WTL ports of CPoint, CRect, CSize, CString, etc.
    你把atlmisc.h也加上吧,就放在#include <atlapp.h>后面好了。
      

  10.   

    把#include <atltypes.h>注释掉试试,因为这里面的CPoint, CRect, CSize与atlmisc.h里的定义冲突了。
      

  11.   


    还是不行,在DockTabSplitPane.h文件中有这么一条宏
    #ifndef __ATLTYPES_H__
    #error DockTabSplitPane.h requires atltypes.h to be included first
    #endif
    去掉这条宏的话,会有更多的错误
      

  12.   

    那就留着#include <atltypes.h>,在include atlmisc.h前面加个宏...
    #define _WTL_NO_WTYPES
    #include <atlmisc.h>
    ...