afxv_w32.h(14) : fatal error C1189: #error :  WINDOWS.H already included.  MFC apps must not #include <windows.h>我的win32 DLL里的一个CPP
#include "stdafx.h"
#include <stdio.h>
#include <winuser.h>
#include <afxwin.h>
BOOL IsWindowsNt()
{
AfxMessageBox("unsupported operation system",MB_ICONSTOP,0);
}
我已经把stdafx.h里面包含#include <windows.h>的内容删除了
还是出现那个错误

解决方案 »

  1.   

    #include <winuser.h>
    #include <afxwin.h>这两行要删掉
      

  2.   

    如果只是Win32 SDK写的,不需要用到MFC,都删掉,只需要一个#include <windows.h>.
    MFC的许多头文件都包含了#include <windows.h>,所以有重复。
      

  3.   

    我是这样创建工程的File->new->Win32 Dynamic Library->A simple project.
    #include "stdafx.h"BOOL APIENTRY DllMain( HANDLE hModule, 
                           DWORD  ul_reason_for_call, 
                           LPVOID lpReserved
     )
    {
    AfxMessageBox("kjfjksf","fsjfkj",MB_OK); // <----I should include <afxwin.h>
        return TRUE;
    }
      

  4.   

    #include <winuser.h>
    #include <afxwin.h>
    ????如果是MFC的程序就只包含后者,如果不是就不应该包含afxwin.h
      

  5.   

    using MessageBox instead of AfxMessageBox,
    resolved by myself.