티스토리 뷰

 

메인프리엠에서 자식 프레임 찾기

1
2
3
4
5
6
7
8
9
10
11
12
13
14
    CStockDoc* pDoc = (CStockDoc*)GetActiveFrame()->GetActiveDocument();
    POSITION pos = pDoc->GetFirstViewPosition();
    CStockView* pView;
    CString str타이틀;
 
    CHogaBuySellDlg* pHogaDlg;
    CMaxMinBuySellDlg* pMaxminDlg;
    CMDIFrameWnd* pMDIFrame;
 
    while (pos != NULL)
    {
        pView = (CStockView*)pDoc->GetNextView(pos);
        pMDIFrame = (CMDIFrameWnd*)pView->GetParentFrame(); // 주문창의 프레임
 
cs

선택된(Active) 된 프레임에서 Document 찾아 View를 순환하면서 찾으려 했으나 while문이 반복 수행 안되고 1회만 되어 선택돤 프레임만 찾게된다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
    CStockDoc* pDoc;    
    CStockView* pView;
    CHogaBuySellDlg* pHogaDlg;
    CMaxMinBuySellDlg* pMaxminDlg;
    
    POSITION pos = theApp.GetFirstDocTemplatePosition();
    CMultiDocTemplate *pTemplate = (CMultiDocTemplate*)theApp.GetNextDocTemplate(pos);
    POSITION posView, posDoc = pTemplate->GetFirstDocPosition();
    
    while (posDoc != NULL)
    {        
        pDoc = (CStockDoc*)pTemplate->GetNextDoc(posDoc);
        posView = pDoc->GetFirstViewPosition();
        pView = (CStockView*)pDoc->GetNextView(posView);
 
        if (pView->m_pDlg->IsKindOf(RUNTIME_CLASS(CHogaBuySellDlg)))
        {
            pHogaDlg = (CHogaBuySellDlg*)pView->m_pDlg;
cs

DocumentTemplate 를 이용해서 접근해야 했다.

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/02   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28