非MFC的DLL中使用CString类

时间:2014-06-22 21:33:01   收藏:0   阅读:229

1.头文件添加

/* 非MFC DLL中使用CString */
#define _AFXDLL
#include <afx.h>


注意:要定义在 #include<windows.h>之前,否则会报错


2.cpp 文件中添加 

/* 非MFC DLL中使用CString */
// The following symbol used to force inclusion of this module for _USRDLL 
#ifdef _X86_
extern "C" { int _afxForceUSRDLL; }
#else
extern "C" { int __afxForceUSRDLL; }
#endif


3.OK 使用CString

非MFC的DLL中使用CString类,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!