将CString字符串类型转换为UINT:
UINT CString_to_UINT(const CString & value)
{
UINT data = 0;
if (value.Find(_T("0x")) == 0)
_stscanf_s((LPCTSTR)value, _T("%x"), &data);
else
_stscanf_s((LPCTSTR)value, _T("%d"), &data);
return data;
}
将CString字符串类型转换为UINT:
UINT CString_to_UINT(const CString & value)
{
UINT data = 0;
if (value.Find(_T("0x")) == 0)
_stscanf_s((LPCTSTR)value, _T("%x"), &data);
else
_stscanf_s((LPCTSTR)value, _T("%d"), &data);
return data;
}