SolidBrush brush(Color(255, 0, 0, 255));//颜色 字体
Gdiplus::Font font(L"Arial", 15, FontStyleRegular,UnitPixel);
graphics.DrawString((const WCHAR*)(LPCTSTR)m_strCarNo,-1,&font,PointF(X-36,Y+16),&brush);
总是显示超常的一串乱码
请问:
字串参数 用CString型如何转 才能显示正确
谢谢
6 个解决方案
#1
应该说的详细一点 阮马是什么?
#2
试试看:
CString m_strCarNo = L"吉A13546";//
CString m_strCarNo = L"吉A13546";//
#3
use T2OLE
#include "atlconv.h"
#include "atlconv.h"
#4
乱码 是一串方块
to: jiangsheng(蒋晟.MSMVP2004Jan)
我加#include "atlconv.h"怎么用阿
to: jiangsheng(蒋晟.MSMVP2004Jan)
我加#include "atlconv.h"怎么用阿
#5
CString m_strCarNo = "吉A13546";//实际中在我的程序里"吉A13546"是从数据库中读的
WCHAR buffer[1024];
wcsset(buffer,0);
MultiByteToWideChar(CP_ACP,0,(char*)LPCSTR(m_strCarNo),(int)strlen((char*)LPCSTR(m_strCarNo)),buffer,1024);
int nLength = wcslen(buffer);
SolidBrush brush(Color(255, 0, 0, 255));//颜色 字体
Gdiplus::Font font(L"Arial", 15, FontStyleRegular,UnitPixel);
graphics.DrawString(buffer,nLength,&font,PointF(X-36,Y+16),&brush);
//注:font的定义也应如此
WCHAR buffer[1024];
wcsset(buffer,0);
MultiByteToWideChar(CP_ACP,0,(char*)LPCSTR(m_strCarNo),(int)strlen((char*)LPCSTR(m_strCarNo)),buffer,1024);
int nLength = wcslen(buffer);
SolidBrush brush(Color(255, 0, 0, 255));//颜色 字体
Gdiplus::Font font(L"Arial", 15, FontStyleRegular,UnitPixel);
graphics.DrawString(buffer,nLength,&font,PointF(X-36,Y+16),&brush);
//注:font的定义也应如此
#6
http://msdn.microsoft.com/library/en-us/vclib/html/_mfcnotes_tn059.asp
#1
应该说的详细一点 阮马是什么?
#2
试试看:
CString m_strCarNo = L"吉A13546";//
CString m_strCarNo = L"吉A13546";//
#3
use T2OLE
#include "atlconv.h"
#include "atlconv.h"
#4
乱码 是一串方块
to: jiangsheng(蒋晟.MSMVP2004Jan)
我加#include "atlconv.h"怎么用阿
to: jiangsheng(蒋晟.MSMVP2004Jan)
我加#include "atlconv.h"怎么用阿
#5
CString m_strCarNo = "吉A13546";//实际中在我的程序里"吉A13546"是从数据库中读的
WCHAR buffer[1024];
wcsset(buffer,0);
MultiByteToWideChar(CP_ACP,0,(char*)LPCSTR(m_strCarNo),(int)strlen((char*)LPCSTR(m_strCarNo)),buffer,1024);
int nLength = wcslen(buffer);
SolidBrush brush(Color(255, 0, 0, 255));//颜色 字体
Gdiplus::Font font(L"Arial", 15, FontStyleRegular,UnitPixel);
graphics.DrawString(buffer,nLength,&font,PointF(X-36,Y+16),&brush);
//注:font的定义也应如此
WCHAR buffer[1024];
wcsset(buffer,0);
MultiByteToWideChar(CP_ACP,0,(char*)LPCSTR(m_strCarNo),(int)strlen((char*)LPCSTR(m_strCarNo)),buffer,1024);
int nLength = wcslen(buffer);
SolidBrush brush(Color(255, 0, 0, 255));//颜色 字体
Gdiplus::Font font(L"Arial", 15, FontStyleRegular,UnitPixel);
graphics.DrawString(buffer,nLength,&font,PointF(X-36,Y+16),&brush);
//注:font的定义也应如此
#6
http://msdn.microsoft.com/library/en-us/vclib/html/_mfcnotes_tn059.asp