CString DOWRD互转 2008-01-10 08:26 378人阅读 评论(0) 收藏
CString怎样转换成DOWRD
#include "stdafx.h"
#include <stdlib.h>
#include <windows.h>
int _tmain(int argc, _TCHAR* argv[])
{
TCHAR szNum[]=_T("123456");//原字符
DWORD dwValue = _tcstoul(szNum, NULL, 16);//把字符转成16位整数
printf("%x", dwValue);
return 0;
}
//dwValue =1193046也就是0x123456.
//---------------------------------------------------------
DOWRD怎样转换成CString
CString str;
DWORD dwValue = 111;
str.Format("%d", dwValue);
#include "stdafx.h"
#include <stdlib.h>
#include <windows.h>
int _tmain(int argc, _TCHAR* argv[])
{
TCHAR szNum[]=_T("123456");//原字符
DWORD dwValue = _tcstoul(szNum, NULL, 16);//把字符转成16位整数
printf("%x", dwValue);
return 0;
}
//dwValue =1193046也就是0x123456.
//---------------------------------------------------------
DOWRD怎样转换成CString
CString str;
DWORD dwValue = 111;
str.Format("%d", dwValue);
版权声明:本文为博主原创文章,未经博主允许不得转载。
posted on 2008-01-10 08:26 Joyfulmath 阅读(119) 评论(0) 编辑 收藏 举报