1.头文件加入

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

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。


注意:要定义在 #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

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄