MFC shared dll version.

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hello,everyone!<br/> It is a windows project.I got the error when I ran it: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]<br/>How can I get rid of it?And this is the source file;<br/><br/>#include<windows.h><br/>#include<afxwin.h><br/>class MyFrameWindow:public CFrameWnd<br/>{public:<br/>    afx_msg void onpaint()<br/> {CPaintDC paintDC(this);<br/>  paintDC.Textout(0,0,"This is my first window");<br/> }<br/> DECLARE_MESSAGE_MAP()<br/>};<br/>BEGIN_MESSAGE_MAP(MyFrameWindow,CFrameWnd)<br/> ON_WM_PAINT()<br/> END_MESSAGE_MAP()
 class HelloApp:public CWinApp<br/>{public:<br/> HelloApp():CWinApp("Hello World!"){}<br/> BOOL InitInstance()<br/> {CFrameWnd *MyFrame=new MyFrameWindow;<br/> M_PMainWnd=MyFrame;<br/> MyFrame->Create(NULL,(LPCTSTR)"Hello");<br/> MyFrame->ShowWindow(SW_SHOW);<br/> return TRUE;<br/> }<br/>}Hello World;<br/><br/>

View the full article
 
Back
Top