Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

strange debugging problem 1

Status
Not open for further replies.

peterworth

Programmer
Aug 18, 2004
80
GB
hi,

i'm trying to figure out why a debug assertion keeps on failing in my program. it's in the initinstance funcrion of an mfc wizard created app:

pMainFrame->ShowWindow(m_nCmdShow);
ASSERT:):IsWindow(pMainFrame->m_hWnd));
pMainFrame->UpdateWindow();

the assert above does NOT fail, but when updatewindow is called immediately after, it goes here:

_AFXWIN_INLINE void CWnd::UpdateWindow()
{ ASSERT:):IsWindow(m_hWnd)); ::UpdateWindow(m_hWnd); }

and this assertion fails, despite being (as far as i can see) identical to the previous assertion.

i'd be very grateful if anyone can point out why this happens, thanks.
 
Is your window being subclassed anywhere? step all the way through the code to make sure that is the hWnd it's referring to; look at the pMainFrame's hWnd and look at the value of the other to see if they're the same.

bdiamond
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top