将关于绘图的操作都放到OnPaint()函数中实现。如果你想在主窗口显示前先显示自己的对话框,需要在 CMyApp类的InitInstance()函数中加上如下代码:CMyDlg myDlg; if (myDlg.DoModal != IDOK) { return FALSE; } CMainDlg dlg; m_pMainWnd = &dlg; int nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: Place code here to handle when the dialog is // dismissed with OK } else if (nResponse == IDCANCEL) { // TODO: Place code here to handle when the dialog is // dismissed with Cancel }
onpaint 事件中 重绘数组数据 就OK
CMyApp类的InitInstance()函数中加上如下代码:CMyDlg myDlg;
if (myDlg.DoModal != IDOK)
{
return FALSE;
} CMainDlg dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
}