不知道为什么,我用的是VS2005的版本,编译时发生错误,换了台机子也还是出现这种情况
d:\install\vc2005\vc\atlmfc\include\afx.h(24) : fatal error C1189: #error : Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]请高手指教
d:\install\vc2005\vc\atlmfc\include\afx.h(24) : fatal error C1189: #error : Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]请高手指教
要选择MFC共享类库
#include<afxwin.h>
class MyFrameWindow :public CFrameWnd
{
public:
afx_msg void OnPaint()
{
CPaintDC paintDC(this);
paintDC.TextOut(0,0,"this is my first window");
}
DECLARE_MESSAGE _MAP()
};BEGIN_MESSAGE_MAP(MyFrameWindow,CFrmaeWnd)
ON_WM_PAINT()
END_MESSAGE_MAP()
class HelloApp :public CWinApp
{
public :
HelloApp() :CWinApp("my the frist window")
{ }
BOOL InitInstance()
{
CFrameWnd *MyFrame =new MyFrameWindow;
m_pMainwWnd=MyFrame;
MyFrame->Create(NULL,(LPCTSTR)"Hello");
MyFrame->ShowWindow(SW_SHOW);
return TRUE;
}
}HelloWorld;
class MyFrameWindow :public CFrameWnd
{
public:
afx_msg void OnPaint()
{
CPaintDC paintDC(this);
paintDC.TextOut(0,0,"this is my first window");
}
DECLARE_MESSAGE _MAP()
};
BEGIN_MESSAGE_MAP(MyFrameWindow,CFrameWnd)
ON_WM_PAINT()
END_MESSAGE_MAP()
class HelloApp :public CWinApp
{
public :
HelloApp() :CWinApp("my the frist window")
{}BOOL InitInstance()
{
CFrameWnd *MyFrame =new MyFrameWindow;
m_pMainwWnd=MyFrame;
MyFrame->Create(NULL,(LPCTSTR)"Hello");
MyFrame->ShowWindow(SW_SHOW);
return TRUE;
}
}HelloWorld;
ON_WM_PAINT()
END_MESSAGE_MAP()