本文使用最简单的方法实现MFC中的CString和string互转。
InBlock.gif    //CString->std::string 例子:
InBlock.gif
    CString strMfc=“test“;
InBlock.gif
    std::string strStl;
InBlock.gif
    strStl=strMfc.GetBuffer(0);
InBlock.gif
    //std::string->CString    例子:
InBlock.gif
    CString strMfc;
InBlock.gif
    std::string strStl=“test“;
InBlock.gif
    strMfc=strStl.c_str();
  该方法使用char* 作为转换中介,简单明了。