hundreds of exactly the same errors. Please Help!!!

Joined
Feb 20, 2009
Messages
1
Reaction score
0
Hi all,

I am currently undertaking a software design course for high school and am the only student using C++ (everyone else is using BASIC). My teacher does not have a great understanding of Visual C++ so I can't ask him.

For some reason on this code:
Code:
void CMainFrame::SwitchToForm(int nForm) //to change between personnel, shift, etc.
{
	CView* pOldActiveView = GetActiveView(); //save old view from active
	CView* pNewActiveView = (CView*)GetDlgItem(nForm); //get new view from func call

	if (pNewActiveView == NULL)     // if it hasn't been created yet
	{                               // create it here
		switch(nForm) // these IDs are the dialog IDs of the view but can use anything
		{
		case IDD_CLICKCLOCK_FORM:
			pNewActiveView = (CView*)new CClickClockView;
		 	break;
		case IDD_CLICKCLOCK_PERS:
		 	pNewActiveView = (CView*)new CPersView;
		 	break;
		case IDD_MULTISCREEN_ROST:
		 	pNewActiveView = (CView*)new CRostView;
		 	break;
		case IDD_CLICKCLOCK_SHIF:
			pNewActiveView = (CView*)new CShiftView;
		 	break;
		} [B]This is line 135[/B]
		CCreateContext context;       // attach the document to the new view
		context.m_pCurrentDoc = pOldActiveView->GetDocument();
		pNewActiveView->Create(NULL, NULL, 0L, CFrameWnd::rectDefault, // and the frame
			this, nForm, &context);
		pNewActiveView->OnInitialUpdate();       
	}

	SetActiveView(pNewActiveView);
	pNewActiveView->ShowWindow(SW_SHOW);
	pOldActiveView->ShowWindow(SW_HIDE);

	::SetWindowWord(pNewActiveView->m_hWnd, GWL_ID, AFX_IDW_PANE_FIRST);
	ReCalcLayout();
	delete pOldActiveView;
}

void CMainFrame::OnViewPersonnel() 
{
	
}

I get these errors:
Code:
--------------------Configuration: ClickClock - Win32 Debug--------------------
Compiling...
MainFrm.cpp
C:\Program Files\Microsoft Visual Studio\MyProjects\ClickClock\MainFrm.cpp(127) : error C2061: syntax error : identifier 'CPersView'
...
C:\Program Files\Microsoft Visual Studio\MyProjects\ClickClock\MainFrm.cpp(135) : error C2143: syntax error : missing ';' before '}'
C:\Program Files\Microsoft Visual Studio\MyProjects\ClickClock\MainFrm.cpp(135) : fatal error C1003: error count exceeds 100; stopping compilation
Error executing cl.exe.

ClickClock.exe - 102 error(s), 0 warning(s)

Any help that anyone could give would be greatly appreciated.

Yours sincerely,
Maddi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top