Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

MDI Application with splitter

Posted on 1997-11-25
3
Medium Priority
?
317 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 60 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
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 concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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.

927 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