在使用了MFC库的工程中CString可以直接使用,在没有使用MFC库的工程中加入#include <atlstr.h>要使用STL里的string,要加入#include <string>注意,不是string.h然后在代码的前面写using namespace std;就可以了