要使用CString类,先包含
#include <afx.h>
然后设置
Project -> Settings, 在 Microsoft Foundation Classese 里选择 " Use MFC in a Shared DLL " 或者 " Use MFC in a Static DLL "
例:
#include "iostream.h"
#include "afx.h"
void main(){
CString str1("abc");
CString str2("def");
CString str=str1+str2;
cout << str <<endl;
}