Click here to Skip to main content
15,886,919 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCMap Issue. Pin
janaswamy uday15-Dec-10 0:19
janaswamy uday15-Dec-10 0:19 
AnswerRe: CMap Issue. Pin
R@jeev K R15-Dec-10 1:25
R@jeev K R15-Dec-10 1:25 
QuestionProblem in closing the thread Pin
learningvisualc14-Dec-10 19:00
learningvisualc14-Dec-10 19:00 
AnswerRe: Problem in closing the thread Pin
Rajesh R Subramanian14-Dec-10 19:52
professionalRajesh R Subramanian14-Dec-10 19:52 
AnswerRe: Problem in closing the thread Pin
Cedric Moonen14-Dec-10 20:45
Cedric Moonen14-Dec-10 20:45 
AnswerRe: Problem in closing the thread Pin
User 742933814-Dec-10 22:06
professionalUser 742933814-Dec-10 22:06 
AnswerRe: Problem in closing the thread Pin
yu-jian15-Dec-10 2:55
yu-jian15-Dec-10 2:55 
QuestionQuestion on MFC program execution procedure [modified] Pin
cy163@hotmail.com14-Dec-10 2:14
cy163@hotmail.com14-Dec-10 2:14 
Hi, ALL

I am using VC++ 6.0. I created a single document MFC application. I did not add any new codes to the project. After compiling, the program works fine.

To learn the execution procedure, i set some break points within
BOOL CxxxApp::InitInstance(), CxxxDoc::OnNewDocument() and CxxxView::OnInitialUpdate().

I run the application in debug mode.

I observe that the program first goes into InitInstance(). After exeuting if(!

ProcessShellCommand(cmdInfo)) within InitInstance(), the program goes into CxxxDoc,then into

CxxxView. After that, the program goes back into InitInstance() again to execute the remaining two statements
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();

I tried but failed to find the intrinsic reason. What makes the program to run in this manner.
I found nowhere CxxxDoc::OnNewDocument() and CxxxView::OnInitialUpdate() are called explicitly

BOOL CxxxApp::InitInstance()
{
	AfxEnableControlContainer();
	
	#ifdef _AFXDLL
		Enable3dControls();
	#else
		Enable3dControlsStatic();
	#endif

	SetRegistryKey(_T("Local...));

	LoadStdProfileSettings();
	CSingleDocTemplate * pDocTemplate;
	pDocTemplate = new CSingleDocTemplate(
		IDR_MAINFRAME,
		RUNTIME_CLASS(CxxxDoc),
		RUNTIME_CLASS(CMainFrame),
		RUNTIME_CLASS(CxxxView));
	AddDocTemplate(pDocTemplate);
	CCommandLineInfo cmdInfo;
	ParseCommandLine(cmdInfo);
	if(!ProcessShellCommand(cmdInfo))<----
		return FALSE;
	m_pMainWnd->ShowWindow(SW_SHOW);
	m_pMainWnd->UpdateWindow();
}


Would you please recommand some reference books or articles on this to me.

modified on Tuesday, December 14, 2010 8:20 AM

AnswerRe: Question on MFC program execution procedure Pin
bleedingfingers14-Dec-10 2:55
bleedingfingers14-Dec-10 2:55 
AnswerRe: Question on MFC program execution procedure Pin
David Crow14-Dec-10 3:02
David Crow14-Dec-10 3:02 
AnswerRe: Question on MFC program execution procedure Pin
yu-jian14-Dec-10 17:59
yu-jian14-Dec-10 17:59 
QuestionBubble sort in CObList [modified] Pin
mesajflaviu14-Dec-10 1:10
mesajflaviu14-Dec-10 1:10 
AnswerRe: Bubble sort in CObList Pin
Richard MacCutchan14-Dec-10 1:59
mveRichard MacCutchan14-Dec-10 1:59 
GeneralRe: Bubble sort in CObList Pin
Cedric Moonen14-Dec-10 2:12
Cedric Moonen14-Dec-10 2:12 
AnswerRe: Bubble sort in CObList Pin
Cedric Moonen14-Dec-10 2:01
Cedric Moonen14-Dec-10 2:01 
GeneralRe: Bubble sort in CObList Pin
mesajflaviu14-Dec-10 2:13
mesajflaviu14-Dec-10 2:13 
GeneralRe: Bubble sort in CObList Pin
Cedric Moonen14-Dec-10 2:18
Cedric Moonen14-Dec-10 2:18 
GeneralRe: Bubble sort in CObList Pin
mesajflaviu14-Dec-10 8:43
mesajflaviu14-Dec-10 8:43 
GeneralRe: Bubble sort in CObList Pin
Rajesh R Subramanian14-Dec-10 19:53
professionalRajesh R Subramanian14-Dec-10 19:53 
GeneralRe: Bubble sort in CObList Pin
mesajflaviu14-Dec-10 21:15
mesajflaviu14-Dec-10 21:15 
GeneralRe: Bubble sort in CObList Pin
thomas.michaud15-Dec-10 3:35
thomas.michaud15-Dec-10 3:35 
AnswerRe: Bubble sort in CObList Pin
Eugen Podsypalnikov14-Dec-10 11:56
Eugen Podsypalnikov14-Dec-10 11:56 
GeneralRe: Bubble sort in CObList Pin
mesajflaviu14-Dec-10 21:14
mesajflaviu14-Dec-10 21:14 
AnswerRe: Bubble sort in CObList Pin
bleedingfingers14-Dec-10 20:27
bleedingfingers14-Dec-10 20:27 
AnswerRe: Bubble sort in CObList Pin
L. Braun14-Dec-10 21:16
L. Braun14-Dec-10 21:16 

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.