这个CString 怎么和 DWORD_PTR相互转换呢?
一、CString转为DWORD_PTR
CString sp("1234");
long PID = _ttol(sp); //CString 转成 char*,该语句缺一不可
cout<<PID<<endl; // 输出结果为:1234
DWORD dw = (DWORD)PID; // 再强制转换成DWORD
cout<<dw<<endl; // 输出结果为:1234
二、DWORD_PTR转为CString
CString strTest;
DWORD dwTest = 111;
strTest.Format(_T("%d"), dwTest);
wcout<<strTest.GetString()<<endl; // 输出结果为:111