我的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>的内容删除了
还是出现那个错误
7 个解决方案
#1
帮帮忙
#2
#include <winuser.h>
#include <afxwin.h>
这两行要删掉
#include <afxwin.h>
这两行要删掉
#3
如果只是Win32 SDK写的,不需要用到MFC,都删掉,只需要一个#include <windows.h>.
MFC的许多头文件都包含了#include <windows.h>,所以有重复。
MFC的许多头文件都包含了#include <windows.h>,所以有重复。
#4
在最顶端加上:
#pragma
#pragma
#5
我是这样创建工程的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;
}
#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;
}
#6
#include <winuser.h>
#include <afxwin.h>
????
如果是MFC的程序就只包含后者,如果不是就不应该包含afxwin.h
#include <afxwin.h>
????
如果是MFC的程序就只包含后者,如果不是就不应该包含afxwin.h
#7
using MessageBox instead of AfxMessageBox,
resolved by myself.
resolved by myself.
#1
帮帮忙
#2
#include <winuser.h>
#include <afxwin.h>
这两行要删掉
#include <afxwin.h>
这两行要删掉
#3
如果只是Win32 SDK写的,不需要用到MFC,都删掉,只需要一个#include <windows.h>.
MFC的许多头文件都包含了#include <windows.h>,所以有重复。
MFC的许多头文件都包含了#include <windows.h>,所以有重复。
#4
在最顶端加上:
#pragma
#pragma
#5
我是这样创建工程的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;
}
#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;
}
#6
#include <winuser.h>
#include <afxwin.h>
????
如果是MFC的程序就只包含后者,如果不是就不应该包含afxwin.h
#include <afxwin.h>
????
如果是MFC的程序就只包含后者,如果不是就不应该包含afxwin.h
#7
using MessageBox instead of AfxMessageBox,
resolved by myself.
resolved by myself.