Click here to Skip to main content
15,903,362 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Creating buttons and CRect Pin
PJ Arends28-Feb-05 6:53
professionalPJ Arends28-Feb-05 6:53 
GeneralRe: Creating buttons and CRect Pin
bcemick28-Feb-05 7:23
bcemick28-Feb-05 7:23 
GeneralRe: Creating buttons and CRect Pin
PJ Arends28-Feb-05 8:05
professionalPJ Arends28-Feb-05 8:05 
GeneralRe: Creating buttons and CRect Pin
bcemick28-Feb-05 8:29
bcemick28-Feb-05 8:29 
GeneralRe: Creating buttons and CRect Pin
PJ Arends28-Feb-05 9:57
professionalPJ Arends28-Feb-05 9:57 
GeneralRe: Creating buttons and CRect Pin
bcemick28-Feb-05 10:12
bcemick28-Feb-05 10:12 
GeneralRe: Creating buttons and CRect Pin
PJ Arends28-Feb-05 10:22
professionalPJ Arends28-Feb-05 10:22 
GeneralRe: Creating buttons and CRect Pin
PJ Arends28-Feb-05 10:29
professionalPJ Arends28-Feb-05 10:29 
Tracing into the MFC source for CButton::Create() we get to this code in CWnd::CreateEx (in Wincore.cpp)
#ifdef _DEBUG
	if (hWnd == NULL)
	{
		TRACE1("Warning: Window creation failed: GetLastError returns 0x%8.8X\n",
			GetLastError());
	}
#endif

	if (!AfxUnhookWindowCreate())
		PostNcDestroy();        // cleanup if CreateWindowEx fails too soon

	if (hWnd == NULL)
		return FALSE;
	ASSERT(hWnd == m_hWnd); // should have been set in send msg hook
	return TRUE;
So there is no way that Create will return TRUE (1) if the HWND is NULL (0).



"You're obviously a superstar." - Christian Graus about me - 12 Feb '03

"Obviously ???  You're definitely a superstar!!!" mYkel - 21 Jun '04

Within you lies the power for good - Use it!
Honoured as one of The Most Helpful Members of 2004

GeneralRe: Creating buttons and CRect Pin
bcemick28-Feb-05 10:55
bcemick28-Feb-05 10:55 
GeneralRe: Creating buttons and CRect Pin
PJ Arends28-Feb-05 11:14
professionalPJ Arends28-Feb-05 11:14 
GeneralRe: Creating buttons and CRect Pin
bcemick28-Feb-05 11:28
bcemick28-Feb-05 11:28 
GeneralRe: Creating buttons and CRect Pin
PJ Arends28-Feb-05 11:39
professionalPJ Arends28-Feb-05 11:39 
GeneralRe: Creating buttons and CRect Pin
bcemick1-Mar-05 3:06
bcemick1-Mar-05 3:06 
GeneralRe: Hidocuments based application Pin
PJ Arends28-Feb-05 10:15
professionalPJ Arends28-Feb-05 10:15 
QuestionRuntime Error! - pure virtual function call? Pin
Antony M Kancidrowski28-Feb-05 2:59
Antony M Kancidrowski28-Feb-05 2:59 
AnswerRe: Runtime Error! - pure virtual function call? Pin
Jay Carter28-Feb-05 3:13
Jay Carter28-Feb-05 3:13 
GeneralRe: Runtime Error! - pure virtual function call? Pin
Antony M Kancidrowski28-Feb-05 3:29
Antony M Kancidrowski28-Feb-05 3:29 
GeneralToolbars with Dropdown Menus Pin
Jay Carter28-Feb-05 2:33
Jay Carter28-Feb-05 2:33 
GeneralHide the selection in CTreeCtrl (the blue color) Pin
anderslundsgard28-Feb-05 1:56
anderslundsgard28-Feb-05 1:56 
Generaldeveloping Server,, protocol independent! Pin
rdhamija28-Feb-05 1:56
rdhamija28-Feb-05 1:56 
GeneralRe: developing Server,, protocol independent! Pin
Tom Wright28-Feb-05 10:36
Tom Wright28-Feb-05 10:36 
QuestionHelp me to create connection in My Network Places? Pin
Chuaaico28-Feb-05 0:50
Chuaaico28-Feb-05 0:50 
AnswerRe: Help me to create connection in My Network Places? Pin
David Crow28-Feb-05 2:51
David Crow28-Feb-05 2:51 
GeneralRe: Help me to create connection in My Network Places? Pin
Chuaaico6-Mar-05 18:08
Chuaaico6-Mar-05 18:08 
GeneralRe: Help me to create connection in My Network Places? Pin
David Crow7-Mar-05 3:17
David Crow7-Mar-05 3:17 

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.