Solved

MDI Application with splitter

Posted on 1997-11-25
3
306 Views
Last Modified: 2008-03-06
I wanted to create an MDI Application with a splitter in the MDI Child Windows and place controls in the 2 splitted regions. After looking at the ViewEx sample program of MS VC++ 5, I think that I know how to do it. But when I write it, I get errors:

BOOL CChildFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
      if (!m_wndSplitter.CreateStatic(this, 1, 2))
            return FALSE;
      if (!m_wndSplitter.CreateView(0, 0,
            pContext->m_pNewViewClass, CSize(100, 100), pContext))
            return FALSE;
      if (!m_wndSplitter.CreateView(0, 1,
            RUNTIME_CLASS(CSourcePiecesView), CSize(0, 0), pContext))
//error C2653: 'CSourcePiecesView' : is not a class or namespace name
//error C2065: 'classCSourcePiecesView' : undeclared identifier
//Note:the base class of 'CSourcePiecesView' is FormView.
            return FALSE;
      SetActiveView((CView*)m_wndSplitter.GetPane(0,1));

      return TRUE;
      
//      return CMDIChildWnd::OnCreateClient(lpcs, pContext);
}

After comparing my code and the code of ViewEx, I still don't know why. Is there any one who can help me?
0
Comment
Question by:sccheung
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 20 total points
ID: 1174064
Have you checked to make sure your source file #includes the header file which declares CSourcePiecesView?


0
 

Author Comment

by:sccheung
ID: 1174065
Oh! Really caused by such a ridiculous mistake? How careless I am. I'll try to see if your answer works. Please wait a minute.
0
 

Author Comment

by:sccheung
ID: 1174066
Oh! You are right. I use Delphi originally. Delphi will ask me to confirm if I wan to add it into the "uses list" instead of saying what is CSourcePiecesView. Microsoft wasted me 25 points!
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
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.

809 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