void CLevelApp::OnImageLevel() { CDocument* pDoc = PIGetActiveDocument(); if (pDoc == NULL) return; if (!pDoc->IsKindOf(RUNTIME_CLASS(CPIDocument))) return; CLevelDlg dlg; dlg.DoModal(); // CLevelDlg* pDlg = new CLevelDlg; // PIDockablePane(pDlg, _T("Test")); }
int CGameView::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CView::OnCreate(lpCreateStruct) == -1) return -1; CLevelDlg dlg; int res =dlg.DoModal(); // domodal로 불렀으므로 이 함수안에서 해결해야됨. if (res == IDCANCEL) exit(1); // x버튼을 누르면 바로 종료한다. if (res == IDOK){ // 바탕색, 글 꼴 전달 gv_bgColor = dlg.ld_rectColor; gv_font = dlg.ld_font; // 난이도 (행, 열, 시간) 전달 CGameDoc *pDlg =GetDocument () ; // Doc 포인터로 pDlg ->gd_nRow =dlg.nRow ; // 입력 pDlg ->gd_nCol =dlg.nCol ; gv_lev =dlg.strLev ; gv_rank =dlg.strRank ; gv_sec = pDlg ->gd_time =dlg.time; while (gv_sec > 59){ // 초가 60이상이면 분으로 옮긴다. ++gv_min ; gv_sec -=60 ; } } // 시간 바 기본 설정 pTimeDlg =new CTimeDlg; pTimeDlg ->color =gv_bgColor ; // 배경색을 넘겨줌 pTimeDlg ->Create (IDD_TIME) ; // 생성 pTimeDlg ->SetParent (this) ; // 뷰를 부모로 둔다. pTimeDlg ->timeCtrl.SetStep (-1) ; // 스텝 값 pTimeDlg ->OnInitDialog () ; // 바탕색 및, 범위 지정 return 0; }