Professional UI Solutions
Site Map   /  Register


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 » Assert in CExtCmdManager::ProfileWndAdd ProfileGetPtr Collapse All
Subject Author Date
Bill Olson Oct 7, 2010 - 4:37 AM

I am attempting to create my own application, and wanted an outer bar like you have in the MDI_DynamicInnerOuterBar sample.  I noticed that the app wizard for my new application put the following in the MainFrame::OnCreate()









In the MDI_DynamicInnerOuterBars example, the same block of code is:










I found that if I used the pApp->pszProfileName as it is used in the sample, I got an assert in CExtCmdManager::ProfileWndAdd() when it got pProfile:



CExtCmdProfile * pProfile = ProfileGetPtr( sProfileName );



pProfile would come back 0.  Looking at this in the debugger in the sample, it comes back with a value.

Initially, I didn’t care too much about it until I tried to create the outer bar and got the same assert in the same location when I created the bar and had this line a few lines later:



    pCmdItem = g_CmdManager->CmdGetPtr(pApp->m_pszProfileName,nCmdID);



I assume there is something in the initialization of the main frame that I missed from the sample, but I can’t find it.  I have compared the code between the sample and my code and as far as I can tell, I’m doing all the same initialization.  What sets the value so pProfile is not NULL?

Bill Olson Oct 14, 2010 - 2:35 AM

That did it. 



Technical Support Oct 7, 2010 - 11:50 AM

The MDI_DynamicInnerOuterBars sample invokes the g_CmdManager->ProfileWndAdd( . . . ) code in the CMainFrame::OnCreate() method because the CMDI_DynamicInnerOuterBarsApp::SetupUiAdvancedOptions() method is already created a new command manager’s profile by invoking the g_CmdManager->ProfileSetup( . . . ) code. You can add new windows only into existing command profiles.