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 » Creating a dialog in a bar. Collapse All
Subject Author Date
Jonas Gauffin Aug 21, 2003 - 10:38 AM

Hello

I’ve trying to create a dialog in a controlbar, i’ve followed the SDI example but cant get it to work. The bar is created ok, but the dialog is not shown.

    if(    !m_wndSearchBar.Create(
            "Searchbar",
            this,
            ID_VIEW_SEARCHBAR
            )
        )
    {
        TRACE0("Failed to create m_wndSearchBar\n");
        return -1;        // fail to create
    }
    if(    !m_wndSearchDlg.Create(IDD_SEARCH, &m_wndSearchBar) )
    {
        TRACE0("Failed to create m_wndSearchDlg\n");
        return -1;        // fail to create
    }

Guillaume Provost Aug 21, 2003 - 11:09 PM

Just a stupid remark (I’m not tech sup, but I thought I’d pitch in if I could help).

I needed to add a <yourWindow>.ShowWindow(SW_SHOW); statement for some of my encapsulated windows to show up.

Also, you might want to delete your registry configuration often while you write your code. Most of the sample apps save all of their GUI status in the windows registry, so while you’re developing and adding windows, your code may be ’reverting’ your code changes by loading your last GUI setup from the registry.

The following lines are responsible for loading the GUI stat from the regs, I’d comment them out while you’re adding/modifying the GUI.

CExtControlBar::ProfileBarStateLoad(this,pApp->m_pszRegistryKey,pApp->m_pszProfileName,pApp->m_pszProfileName,&m_dataFrameWP);

and the following lines load back GUI customization features back up:

m_customSite.CustomizeStateLoad(pApp->m_pszRegistryKey,pApp->m_pszProfileName,pApp->m_pszProfileName);

Cheers!

Guillaume.

Jonas Gauffin Aug 22, 2003 - 12:57 AM

Mkay. I thought that ShowWindow were handled by the library since it’s not used in the sample, but I’ll try that + cleaning the reg =)

thanks

Technical Support Aug 22, 2003 - 4:20 AM

Dear Jonas,

Mr. Guillaume gave a good piece of advice. Besides, please verify the following when creating child dialogs:

  • Any dialog resource has the Dialog Type property which should be set to Child (not Popup)
  • The Visible property of your dialog resource should be set to true

Jonas Gauffin Aug 23, 2003 - 1:35 AM

hehe... it was that simple! :) Thanks!