码迷,mamicode.com
首页 > 其他好文 > 详细

string 转 LPCWSTR

时间:2015-05-27 15:48:02      阅读:134      评论:0      收藏:0      [点我收藏+]

标签:mfc   win32   string   lpctstr   lpstr   

virtual BOOL TextOut(
   int x,
   int y,
   LPCTSTR lpszString,
   int nCount 
);
BOOL TextOut(
   int x,
   int y,
   const CString& str 
);

WM_LBUTTONDOWN: {
                             hdc = BeginPaint(hWnd, &ps);
                             UINT x = lParam;
                             UINT y = wParam;

                             //LPSTR info;
                             //sprintf(info, "(%d, %d)", x, y);
                             std::string s1("( " + x);
                             std::string s2(" , ");
                             std::string s3(y + " )");

                             std::string str = s1 + s2 + s3;

                            TextOut(hdc, 50, 50, (LPCWSTR)(str.c_str()), 6);
        }
        
        break;

string 转 LPCWSTR

标签:mfc   win32   string   lpctstr   lpstr   

原文地址:http://blog.csdn.net/haimian520/article/details/46047393

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!