Click here to Skip to main content
15,922,427 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how to write a file of bytes Pin
Brigit Ananya24-May-07 3:26
Brigit Ananya24-May-07 3:26 
QuestionSTL map question Pin
User 58385223-May-07 19:00
User 58385223-May-07 19:00 
AnswerRe: STL map question Pin
led mike23-May-07 19:48
led mike23-May-07 19:48 
GeneralRe: STL map question Pin
User 58385223-May-07 19:52
User 58385223-May-07 19:52 
GeneralRe: STL map question Pin
led mike24-May-07 4:45
led mike24-May-07 4:45 
AnswerRe: STL map question Pin
markkuk23-May-07 22:16
markkuk23-May-07 22:16 
AnswerRe: STL map question Pin
BadKarma23-May-07 22:56
BadKarma23-May-07 22:56 
QuestionWithout m_pMainWnd Pin
sawerr23-May-07 18:40
sawerr23-May-07 18:40 
Hi I am trying to understand the function of m_pMainWnd. But i have a problem.
For example

BOOL CMyApp::InitInstance()<br />
{<br />
	CMyWindow *MyWindow = new CMyWindow();//derived from CFrameWnd<br />
	m_pMainWnd = MyWindow;//If i remove here, it shows and closes window <br />
	MyWindow->Create(NULL, L"window");<br />
	// m_pMainWnd->Create(...) calls Cwnd::Create not CFrameWnd::Create like in m_pMainWnd = MyWindow<br />
	MyWindow->ShowWindow(m_nCmdShow);<br />
	MyWindow->UpdateWindow();<br />
	return TRUE;<br />
};


1-) What is happening in m_pMainWnd = MyWindow assignment so window does not close immediately? Is this assignment call some functions in CwinThread class? Or something else?

2-) Also this is very interesting for me and i do not understand why it is so.
I assigned m_pMainWnd MyWindow object that derived from CFrameWnd class so m_pMainWnd holds CFrameWnd object but m_pMainWnd->Create(...) calls Cwnd::Create not CFrameWnd::Create ? Why is it so? How can it be?

Can you please help me to understand this assignment.
I am looking for your answers...
AnswerRe: Without m_pMainWnd Pin
Naveen23-May-07 18:56
Naveen23-May-07 18:56 
GeneralRe: Without m_pMainWnd Pin
sawerr23-May-07 19:40
sawerr23-May-07 19:40 
GeneralRe: Without m_pMainWnd Pin
Naveen23-May-07 19:50
Naveen23-May-07 19:50 
GeneralRe: Without m_pMainWnd Pin
tom groezer24-May-07 1:24
tom groezer24-May-07 1:24 
GeneralRe: Without m_pMainWnd Pin
Mark Salsbery24-May-07 7:37
Mark Salsbery24-May-07 7:37 
GeneralRe: Without m_pMainWnd Pin
Naveen24-May-07 13:57
Naveen24-May-07 13:57 
QuestionGit image on button Pin
prathuraj23-May-07 18:13
prathuraj23-May-07 18:13 
AnswerRe: Git image on button Pin
Hamid_RT23-May-07 18:53
Hamid_RT23-May-07 18:53 
GeneralRe: Git image on button Pin
prathuraj23-May-07 19:00
prathuraj23-May-07 19:00 
GeneralRe: Git image on button Pin
Hamid_RT23-May-07 19:04
Hamid_RT23-May-07 19:04 
AnswerRe: Git image on button Pin
Mark Salsbery24-May-07 7:39
Mark Salsbery24-May-07 7:39 
QuestionHow to disable a specified USB-FLASH DISK on WM_DEVICECHANGE Pin
wangerpang23-May-07 17:41
wangerpang23-May-07 17:41 
QuestionAny suggestion in implementing this idea? Pin
Aint23-May-07 15:26
Aint23-May-07 15:26 
QuestionRe: Any suggestion in implementing this idea? Pin
Hamid_RT23-May-07 19:01
Hamid_RT23-May-07 19:01 
AnswerRe: Any suggestion in implementing this idea? Pin
Aint24-May-07 22:50
Aint24-May-07 22:50 
GeneralRe: Any suggestion in implementing this idea? Pin
Hamid_RT25-May-07 1:42
Hamid_RT25-May-07 1:42 
AnswerRe: Any suggestion in implementing this idea? Pin
Nelek23-May-07 20:05
protectorNelek23-May-07 20:05 

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.