Click here to Skip to main content
15,885,878 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionA simple question about Static Controls Pin
tiwal10-Dec-14 20:54
tiwal10-Dec-14 20:54 
AnswerRe: A simple question about Static Controls Pin
tiwal10-Dec-14 20:56
tiwal10-Dec-14 20:56 
AnswerRe: A simple question about Static Controls Pin
«_Superman_»10-Dec-14 21:56
professional«_Superman_»10-Dec-14 21:56 
AnswerRe: A simple question about Static Controls Pin
Richard MacCutchan10-Dec-14 22:06
mveRichard MacCutchan10-Dec-14 22:06 
GeneralRe: A simple question about Static Controls Pin
tiwal10-Dec-14 23:37
tiwal10-Dec-14 23:37 
Questionhow to replace \n with alt+enter while exporting to .CSV Pin
sma123#10-Dec-14 6:17
sma123#10-Dec-14 6:17 
AnswerRe: how to replace \n with alt+enter while exporting to .CSV Pin
Jochen Arndt10-Dec-14 9:28
professionalJochen Arndt10-Dec-14 9:28 
QuestionPlease what is wrong with this my MFC code, what am I doing wrong? Pin
Gbenbam9-Dec-14 22:55
Gbenbam9-Dec-14 22:55 
Normally, I code using win32 API. I just moved to MFC.

I wrote this MFC code for a wizard but keep getting exceptions thrown. A first chance exception to be precise.

My wizard is contained in an MFC extension dll.

The wizard is lunch from an handler of CMainFrame.

The CMainFrame from which the wizard is lunched is:

C++
void CMainFrame::OnAddClassInfo()
{
	CWinApp *pWinApp = AfxGetApp();

	FirstPage firstPage;
	ClassNameA className;
	ClassTerm classTerm;
	ClassSubjects classSubjects;
	ClassStaff classStaff;
	StopPage stopPage;

	className.SetAccess(m_szAccessUsername,m_szAccessPassword);
	className.SetClassInfo(m_iClassTypeID, m_iClassID);
	stopPage.SetClassInfoCombo(&m_wndToolBar.m_ArmName,&m_wndToolBar.m_ClassName,&m_wndToolBar.m_Session);

	CString stWizard;
	stWizard.LoadString(pWinApp->m_hInstance,IDS_CLASSINFO_WIZARD,(WORD)LANGUAGE);

	ClassInfo ClassInfoWizard(stWizard,this);

	firstPage.SetPointer(reinterpret_cast<ULONG_PTR>(&ClassInfoWizard));
	className.SetPointer(reinterpret_cast<ULONG_PTR>(&ClassInfoWizard));
	classTerm.SetPointer(reinterpret_cast<ULONG_PTR>(&ClassInfoWizard));
	classSubjects.SetPointer(reinterpret_cast<ULONG_PTR>(&ClassInfoWizard));
	classStaff.SetPointer(reinterpret_cast<ULONG_PTR>(&ClassInfoWizard));
	stopPage.SetPointer(reinterpret_cast<ULONG_PTR>(&ClassInfoWizard));
	

	ClassInfoWizard.AddPage(&firstPage);
	ClassInfoWizard.AddPage(&className);
	ClassInfoWizard.AddPage(&classTerm);
	ClassInfoWizard.AddPage(&classSubjects);
	ClassInfoWizard.AddPage(&classStaff);
	ClassInfoWizard.AddPage(&stopPage);

	ClassInfoWizard.SetWizardMode();
	if(ClassInfoWizard.DoModal() == ID_WIZFINISH)
	{
		m_eClassInfoView_State = ENABLE;
		m_eClassInfoChange_State = ENABLE;

		m_eStudentInfoAdd_State = ENABLE;

		m_eGradeInfoAdd_State = ENABLE;
	}
}


The output window show the following error messages:


First-chance exception at 0xfefefefe in SchPedestal.exe: 0xC0000005: Access violation.
Unhandled exception at 0xfefefefe in SchPedestal.exe: 0xC0000005: Access violation.
The program '[1456] SchPedestal.exe: Native' has exited with code -1073741819 (0xc0000005).
Note:
ClassInfo inherits from CPropertySheet, while the other objects inherit from CPropertyPage.

modified 11-Dec-14 6:33am.

SuggestionRe: Please what is wrong with this my MFC code, what am I doing wrong? Pin
Jochen Arndt9-Dec-14 23:32
professionalJochen Arndt9-Dec-14 23:32 
GeneralRe: Please what is wrong with this my MFC code, what am I doing wrong? Pin
Gbenbam11-Dec-14 0:20
Gbenbam11-Dec-14 0:20 
GeneralRe: Please what is wrong with this my MFC code, what am I doing wrong? Pin
Jochen Arndt11-Dec-14 2:15
professionalJochen Arndt11-Dec-14 2:15 
AnswerRe: Please what is wrong with this my MFC code, what am I doing wrong? Pin
Jochen Arndt9-Dec-14 23:36
professionalJochen Arndt9-Dec-14 23:36 
AnswerRe: Please what is wrong with this my MFC code, what am I doing wrong? Pin
David Crow10-Dec-14 17:28
David Crow10-Dec-14 17:28 
GeneralRe: Please what is wrong with this my MFC code, what am I doing wrong? Pin
Gbenbam11-Dec-14 1:09
Gbenbam11-Dec-14 1:09 
GeneralRe: Please what is wrong with this my MFC code, what am I doing wrong? Pin
Freak3011-Dec-14 3:11
Freak3011-Dec-14 3:11 
GeneralRe: Please what is wrong with this my MFC code, what am I doing wrong? Pin
Richard MacCutchan11-Dec-14 6:39
mveRichard MacCutchan11-Dec-14 6:39 
GeneralRe: Please what is wrong with this my MFC code, what am I doing wrong? Pin
Gbenbam16-Dec-14 20:22
Gbenbam16-Dec-14 20:22 
QuestionVariable in flash memory - how to write? Pin
elelont29-Dec-14 20:43
elelont29-Dec-14 20:43 
AnswerRe: Variable in flash memory - how to write? Pin
Jochen Arndt9-Dec-14 21:33
professionalJochen Arndt9-Dec-14 21:33 
GeneralRe: Variable in flash memory - how to write? Pin
elelont29-Dec-14 22:39
elelont29-Dec-14 22:39 
GeneralRe: Variable in flash memory - how to write? Pin
Jochen Arndt9-Dec-14 23:28
professionalJochen Arndt9-Dec-14 23:28 
GeneralRe: Variable in flash memory - how to write? Pin
elelont210-Dec-14 0:06
elelont210-Dec-14 0:06 
QuestionC/C++ files with "Ex" suffixes Pin
david211149-Dec-14 12:10
david211149-Dec-14 12:10 
AnswerRe: C/C++ files with "Ex" suffixes Pin
Garth J Lancaster9-Dec-14 13:25
professionalGarth J Lancaster9-Dec-14 13:25 
GeneralRe: C/C++ files with "Ex" suffixes Pin
David Crow9-Dec-14 16:49
David Crow9-Dec-14 16:49 

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.