Click here to Skip to main content
15,898,374 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Hello all I want to capture an image from a Camera Pin
GegoTheWizard3-Mar-04 9:05
GegoTheWizard3-Mar-04 9:05 
GeneralRe: Hello all I want to capture an image from a Camera Pin
Chiew Heng Wah3-Mar-04 14:47
Chiew Heng Wah3-Mar-04 14:47 
GeneralRe: Hello all I want to capture an image from a Camera Pin
GegoTheWizard23-Mar-04 12:51
GegoTheWizard23-Mar-04 12:51 
GeneralMFC help!!! Pin
modeonetwo2-Mar-04 8:58
modeonetwo2-Mar-04 8:58 
GeneralRe: MFC help!!! Pin
GegoTheWizard2-Mar-04 9:23
GegoTheWizard2-Mar-04 9:23 
GeneralRe: MFC help!!! Pin
David Crow2-Mar-04 9:23
David Crow2-Mar-04 9:23 
GeneralRe: MFC help!!! Pin
modeonetwo2-Mar-04 12:43
modeonetwo2-Mar-04 12:43 
GeneralTrying to create static splitter... Pin
Nat292-Mar-04 7:41
Nat292-Mar-04 7:41 
Confused | :confused:

Using CSplitterWnd class

I’m trying to learn how to work with CSplitterWnd class.
I create a simple SDI application using MFC Application Wizard.
Classes created are:
CMySDIApp
CMySDIDoc
CMySDIView
CMainFrame

I want to have two different views for my document. For the second view, I add a new class to my project – CMySDIView2 class is derived from CView.

I want to have static splitter with two panes. I override OnCreateClient :

CMainFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/,
CCreateContext* pContext)
{
// create a splitter with 1 row, 2 columns
if (!m_wndSplitter.CreateStatic(this, 1, 2))
{
TRACE0("Failed to CreateStaticSplitter\n");
return FALSE;
}

// add the first splitter pane - the default view in column 0
if (!m_wndSplitter.CreateView(0, 0,
RUNTIME_CLASS(CMySDIView), CSize(0, 0), pContext))
{
TRACE0("Failed to create first pane\n");
return FALSE;
}

// add the second splitter pane - an input view in column 1
if (!m_wndSplitter.CreateView(0, 1,
RUNTIME_CLASS(CMySDIView2), CSize(0, 0), pContext))
{
TRACE0("Failed to create second pane\n");
return FALSE;
}

return TRUE;
}


When I build the project, I get two errors:

error C2653: 'CMySDIView' : is not a class or namespace name
//RUNTIME_CLASS(CMySDIView), CSize(0, 0), pContext))
error C2653: 'CMySDIView2' : is not a class or namespace name
//RUNTIME_CLASS(CMySDIView2), CSize(0, 0), pContext))


What am I doing wrong?

Thank you for your help!

GeneralRe: Trying to create static splitter... Pin
Antti Keskinen2-Mar-04 8:24
Antti Keskinen2-Mar-04 8:24 
GeneralRe: Trying to create static splitter... Pin
Nat292-Mar-04 9:15
Nat292-Mar-04 9:15 
GeneralRe: Trying to create static splitter... Pin
David Crow2-Mar-04 9:27
David Crow2-Mar-04 9:27 
GeneralRe: Trying to create static splitter... Pin
Nat292-Mar-04 10:34
Nat292-Mar-04 10:34 
GeneralRe: Trying to create static splitter... Pin
David Crow2-Mar-04 10:37
David Crow2-Mar-04 10:37 
GeneralRe: Trying to create static splitter... Pin
Nat292-Mar-04 11:22
Nat292-Mar-04 11:22 
GeneralGetting content from HTML control Pin
Vikram A Punathambekar2-Mar-04 5:55
Vikram A Punathambekar2-Mar-04 5:55 
GeneralRe: Getting content from HTML control Pin
Ravi Bhavnani2-Mar-04 6:58
professionalRavi Bhavnani2-Mar-04 6:58 
GeneralRe: Getting content from HTML control Pin
Vikram A Punathambekar2-Mar-04 7:05
Vikram A Punathambekar2-Mar-04 7:05 
GeneralRe: Getting content from HTML control Pin
Ravi Bhavnani2-Mar-04 7:47
professionalRavi Bhavnani2-Mar-04 7:47 
GeneralRe: Getting content from HTML control Pin
Vikram A Punathambekar2-Mar-04 7:34
Vikram A Punathambekar2-Mar-04 7:34 
GeneralRe: Getting content from HTML control Pin
Ravi Bhavnani2-Mar-04 7:50
professionalRavi Bhavnani2-Mar-04 7:50 
GeneralRe: Getting content from HTML control Pin
Ravi Bhavnani2-Mar-04 8:22
professionalRavi Bhavnani2-Mar-04 8:22 
GeneralRe: Getting content from HTML control Pin
Vikram A Punathambekar2-Mar-04 9:32
Vikram A Punathambekar2-Mar-04 9:32 
GeneralRe: Getting content from HTML control Pin
Ravi Bhavnani2-Mar-04 11:17
professionalRavi Bhavnani2-Mar-04 11:17 
GeneralRe: Getting content from HTML control Pin
David Crow2-Mar-04 7:29
David Crow2-Mar-04 7:29 
GeneralWriting large STL vectors to file Pin
inter8ection2-Mar-04 5:52
inter8ection2-Mar-04 5:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.