Solved

MDI Application with splitter

Posted on 1997-11-25
3
308 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

829 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