Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » CExtNCSB dynamic creation fails Collapse All
Subject Author Date
Torsten Schucht Jul 31, 2009 - 3:45 AM

This post might be duplicated. I posted this earlier today but it did not show up in the forum.


I have got a problem with dynamically creating a CExtNCSB<CListBox>. The debugger stops during the call to Create(). I figured out, that the GetParent() method in NCSB_GetParentWindow() returns a wrong parent. Not the one I passed to the Create() method.


Then a crash occurs in NCSB_InstantiateAndCreateContainer() in the call pWnd->Create( pWndParent ).


When I create the listbox from a resource, everythin is OK. Only the dynamic creation fails. I have compare all style flags. They are equal.


Do you have any idea what the reason for the wrong parent could be?


 

Technical Support Aug 2, 2009 - 1:17 PM

It looks like you encountered a conflict with MFC’s window creation hooking mechanism. Please configure your CExtNCSB < CListBox > window to use delayed scroll bar initialization. This means you should invoke the constructor of the CExtNCSB class with parameter:

CExtNCSB < CListBox > * pYourDynamicListBox = new CExtNCSB < CListBox > ( true );