?
Solved

2 pannels whith a dialog

Posted on 1998-12-15
8
Medium Priority
?
314 Views
Last Modified: 2012-06-21
I need use 2 pannels in my application. In the first - I use
CTreeView class and in the second - DetailDlg class derived from CDialog.
(like "Ole/Com Object Viewer" from MS DeveloperStudio Tools)
 I use DECLARE_DYNCREATE(DetailDlg) and IMPLEMENT_DYNCREATE(DetailDlg, CDialog).

after exequtin function
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
      // TODO: Add your specialized code here and/or call the base class

      //Create splitter for 2 pannels.      
      if (m_wndSplitter.CreateStatic(this,1,2))
      {
            CRect rect;
            GetClientRect(&rect);
            CSize size = rect.Size();
            size.cx-=100;
            
            // Run 2 view classes and set active pannel.
            if (m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(CMapView),size,pContext))
            {
                  if (m_wndSplitter.CreateView(0,1,RUNTIME_CLASS(DetailDlg),CSize(0,0),pContext))
                  {
                        SetActiveView((CView*)m_wndSplitter.GetPane(0,0));
                        return TRUE;      
                  }
            }
      }

      return CFrameWnd::OnCreateClient(lpcs, pContext);
}
I don't see my dialg.(only transperent frame)
What is a problem? Haw I can to connect to CDialog class in the pannel
When I use CView (not CDialog) this problem is not exist.
My platform Windows NT, VC++ 5.
Thanks.
0
Comment
Question by:atkach
  • 5
  • 3
8 Comments
 

Author Comment

by:atkach
ID: 1180205
Edited text of question
0
 

Author Comment

by:atkach
ID: 1180206
Edited text of question
0
 

Author Comment

by:atkach
ID: 1180207
Edited text of question
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 4

Accepted Solution

by:
nil_dib earned 400 total points
ID: 1180208
You have to use CFormView insted of CDialog as base class if
you want to display dialog elements,
because you can only connect to views in CSpiltterWnd.
In the CFormView you can use all resouces like in a dialog.
After drawing the dialog with the resource workshop use the class
wizzard to create a new class which is not derive from CDialog
but from CFormView!
0
 
LVL 4

Expert Comment

by:nil_dib
ID: 1180209
Look for sample MFC->general->Viewex
0
 

Author Comment

by:atkach
ID: 1180210
I prepare dialog according CFormView help and derived my class DetailDlg from CFormView.
But when I try to create this view :
   m_wndSplitter.CreateView(0,1,RUNTIME_CLASS(DetailDlg),CSize(0,0),pContext);
I got JPF in the function CreateView.
0
 
LVL 4

Expert Comment

by:nil_dib
ID: 1180211
What is JPF?
Do you set the properties of the dialog: style = child and border = none
in the resource workshop?
I created a new project with the wizzard:
wizzard step 4 -> advanced -> window styles -> use split windows
resource workshop -> insert new dialog -> properties: style = child and border = none
-> class wizzard -> create new class (derive from CFormView).
edit CMainFrame::OnCreateClient:

BOOL CMainFrame::OnCreateClient( LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
     if (m_wndSplitter.CreateStatic(this,1,2))
     {
          CRect rect;
          GetClientRect(&rect);
          CSize size = rect.Size();
          size.cx-=100;

          if (m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(CTestView),size,pContext))
          {
               if (m_wndSplitter.CreateView(0,1,RUNTIME_CLASS(CDlgView),CSize(0,0),pContext))
               {
                    SetActiveView((CView*)m_wndSplitter.GetPane(0,0));
                    return TRUE;
               }
          }
     }
     return CFrameWnd::OnCreateClient(lpcs, pContext);
}

this works fine!?
dib
0
 

Author Comment

by:atkach
ID: 1180212
Thanks, nil_dib.
I am also found a problem whith styles of the dialog.

0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question