Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>At work, using visual studio 2010, we successfully created a managed c++ test project to test mfc code. </p> <p>We began creating a c++ test project using the wizard. Then, in the configuration properties of the unit test project, change the following :</p> <ul> <li>General->Use of MFC = changed to "Use MFC in a shared DLL"</li> <li>General->Common language runtime support = changed to "Common language support (/clr)</li> <li>(In debug config only) Linker->Output->Ignore Specific Default Libraries = add MSVCRT</li> </ul> <p>In the stdafx.h : I have the following</p> <pre><code>// Modify the following defines if you have to target a platform prior to the ones specified below. // Refer to MSDN for the latest info on corresponding values for different platforms. #ifndef WINVER // Allow use of features specific to Windows XP or later. #define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows. #endif #ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later. #define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows. #endif #ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later. #define _WIN32_IE 0x0600 // Change this to the appropriate value to target other versions of IE. #endif #include &lt;afxwin.h&gt; // MFC core and standard components #include &lt;afxext.h&gt; // MFC extensions #ifndef _AFX_NO_OLE_SUPPORT #include &lt;afxole.h&gt; // MFC OLE classes #include &lt;afxodlgs.h&gt; // MFC OLE dialog classes #include &lt;afxdisp.h&gt; // MFC Automation classes #endif // _AFX_NO_OLE_SUPPORT #ifndef _AFX_NO_DB_SUPPORT #include &lt;afxdb.h&gt; // MFC ODBC database classes #endif // _AFX_NO_DB_SUPPORT #include &lt;afxdtctl.h&gt; // MFC support for Internet Explorer 4 Common Controls #ifndef _AFX_NO_AFXCMN_SUPPORT #include &lt;afxcmn.h&gt; // MFC support for Windows Common Controls #endif // _AFX_NO_AFXCMN_SUPPORT </code></pre> <p>And everything works like a charm! Let me know if it works for you</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload