我建立一个dialog对话框程序,我在MyDlg.cpp文件中定义了一个函数void showsome();
我想在这个函数中使用 TextOut()、MoveTo()和LineTo();
请问我需要怎样做才可以做到?
我好象知道用ClassWizard生成的函数就可以直接用
CDC* pDC = GetDC();
pDC->TextOut()
pDC->MoveTo()
和pDC->LineTo();
ReleaseDC(pDC);
但在自己定义的函数中不能用CDC* pDC = GetDC();ReleaseDC(pDC);
请问我现在如何办?
急用,谢谢?
我想在这个函数中使用 TextOut()、MoveTo()和LineTo();
请问我需要怎样做才可以做到?
我好象知道用ClassWizard生成的函数就可以直接用
CDC* pDC = GetDC();
pDC->TextOut()
pDC->MoveTo()
和pDC->LineTo();
ReleaseDC(pDC);
但在自己定义的函数中不能用CDC* pDC = GetDC();ReleaseDC(pDC);
请问我现在如何办?
急用,谢谢?
void showsome(CDC *pDc,...){
pDC->TextOut()
pDC->MoveTo()
和pDC->LineTo();
}
谢谢
pDC->TextOut
......
BOOL LineTo(
HDC hdc, // device context handle
int nXEnd, // x-coordinate of ending point
int nYEnd // y-coordinate of ending point
);
BOOL TextOut(
HDC hdc, // handle to DC
int nXStart, // x-coordinate of starting position
int nYStart, // y-coordinate of starting position
LPCTSTR lpString, // character string
int cbString // number of characters
);
CClientDC dc(this)
dc.TextOut()
dc.MoveTo()
dc.LineTo();
dc.MovoTo()
dc.LineTo();
或者采用nuaawenlin(飘人) 的去做
dc.textout(..);
{
// TODO: Add extra validation here
CDC* pDC=AfxGetMainWnd()->GetDC();
pDC->TextOut(300,300,"rinima");
AfxMessageBox("rinima");
ReleaseDC(pDC);
CDialog::OnOK();
}