非MFC工程中用CString

来源:互联网 发布:led广告牌制作软件 编辑:程序博客网 时间:2024/05/21 17:58

1  赋值一下代码到工程

  #ifdef _DEBUG  

  #pragma comment(lib, "libcmtd.lib")  

  #else   #pragma comment(lib, "libcmt.lib")  

  #endif

2  在工程中建一个CPP文件DLLMODEUL.CPP

3  此CPP文件内容如下

   #include "stdafx.h"  

   #ifdef _DEBUG    

   #undef THIS_FILE   static char THIS_FILE[] = __FILE__;     

   #endif   

  #define new    DEBUG_NEW    /////////////////////////////////////////////////////////////////////////////   //              global data    // The following symbol used to force inclusion of this module for _USRDLL  

   #ifdef _X86_   extern "C" { int _afxForceUSRDLL; }   #else   extern "C" { int __afxForceUSRDLL; }     #endif #include "stdafx.h"  

  #ifdef _DEBUG   #undef THIS_FILE   static char THIS_FILE[] = __FILE__;   #endif    #define new DEBUG_NEW    /////////////////////////////////////////////////////////////////////////////   // global data    // The following symbol used to force inclusion of this module for _USRDLL   #ifdef _X86_      extern "C" { int _afxForceUSRDLL; }   #else   extern "C" { int __afxForceUSRDLL; }   #endif 

4  打开stdafx.h,把afx.h包含在windows.h前面

5  ok

原创粉丝点击