将 CString 替换为 mingw 编译器中的 eclipse

Replacing CString in mingw compiler for eclipse

本文关键字:eclipse 编译器 mingw CString 替换      更新时间:2023-10-16

我有一些比较大的代码,但其中有一部分使用了名为CString(http://msdn.microsoft.com/en-us/library/aa300688%28v=vs.60%29.aspx)的东西。现在我正在 eclipse 上使用 mingw 编译器,它似乎没有识别出它,这是有意义的。但是我需要使用代码的另一部分。我知道我可以用 const char * 替换 CString,但有几个函数,如 append,代码使用但没有定义。我想知道移植此代码的最佳方法是什么?还有其他 stdafx.h 依赖项,如 _T()。我现在应该采取的最佳方法是什么?

CodeProject 上有一个 CString 替代品。我只是在谷歌上搜索"CString alternative"。我没有看过它,但它应该更容易使用它而不是std::string.