1、CString 类型和 TCHAR 类型之间的变量,怎样实现付值?
2、怎样从MFC常规DLL中传一个CString类型的变量给 调用它的EXE程序?

解决方案 »

  1.   

    1。typedef char TCHAR, *PTCHAR; TCHAR是UNICODE的 ,_T就是把char转化为TCHAR
    详细的看看这两篇吧
    http://expert.csdn.net/Expert/topic/2398/2398212.xml?temp=.3510706
    http://www.ddjchina.com/Articles/ShowArticles.aspx?ArticleID=116
    2。用LPSTR代替CString
      

  2.   

    CString str = _T("adfad");
    TCHAR ch = str[2];
    TCHAR* pch = (LPCTSTR)str;
    char* psz = (LPSTR)(LPCTSTR)str;最好是返回LPCTSTR,这样可以支持UNICODE了