程序中有
pDC->DrawText(rcClient.Width()-size.cx,size.cy,str);
编译时显示
int __thiscall CDC::DrawTextW(const class CString &,struct tagRECT *,unsigned int)' : cannot convert parameter 2 from 'long' to 'struct tagRECT *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
现在不知如何着手去改,望达人告知。多谢!
strGird=L"CH";
dcMem.DrawText(strGird,CRect(0,200,10,210), DT_NOCLIP);
哦应该是 pDC->DrawText(strGird,CRect(0,200,10,210), DT_NOCLIP);
lz好好看错误提示;
里面明确指出了drawtext的函数声明方式,你根据提示做就行了。
DrawTextW(const class CString &,struct tagRECT *,unsigned int)
对阿,错误提示都说不能把'long' 转换成 'struct tagRECT *'啦,自己改吧
- virtual int DrawText (
- LPCTSTR lpszString,
- int nCount,
- LPRECT lpRect,
- UINT nFormat );
- int DrawText(
- const CString& str,
- LPRECT lpRect,
- UINT nFormat );
从楼主的程序看应该用的是第二种
pDC->DrawText(_T("test"),CRect(0,200,10,210), DT_NOCLIP);