现在我在程序中有两个窗体,
父窗体调用子窗体,
子窗体要引用窗体的变量m_addr(是在父窗体的public中声明的)。
我在子窗体中是这样写的:
void CTvPreview::OnPaint()
{
CPaintDC pDC(this); // device context for painting
pDC.TextOut(200,200,CTDlg.m_addr);
}error C2275: 'CTDlg' : illegal use of this type as an expression
see declaration of 'CTDlg'
我应该如何写代码才对??
请各位市高手不吝赐教!!
父窗体调用子窗体,
子窗体要引用窗体的变量m_addr(是在父窗体的public中声明的)。
我在子窗体中是这样写的:
void CTvPreview::OnPaint()
{
CPaintDC pDC(this); // device context for painting
pDC.TextOut(200,200,CTDlg.m_addr);
}error C2275: 'CTDlg' : illegal use of this type as an expression
see declaration of 'CTDlg'
我应该如何写代码才对??
请各位市高手不吝赐教!!
void CTvPreview::OnPaint()
{
CTDlg* pParWnd=(CTDlg*)GetParent();
CPaintDC pDC(this); // device context for painting
pDC.TextOut(200,200,pParWnd->m_addr);
}
{
CTDlg* pParWnd=(CTDlg*)GetParent();
CPaintDC pDC(this); // device context for painting
pDC.TextOut(200,200,pParWnd->m_addr);
}
这样写好象也不可以。
在执停时,停在那里行时,程序不再受控制
How can I do???