Solved

MDI Application with splitter

Posted on 1997-11-25
3
296 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
Comment Utility
Have you checked to make sure your source file #includes the header file which declares CSourcePiecesView?


0
 

Author Comment

by:sccheung
Comment Utility
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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
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…
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 learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now