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 » Loading of CExtThemeSwitcherToolControlBar fails Collapse All
Subject Author Date
Rado Manzela May 21, 2010 - 8:45 AM

I have CExtThemeSwitcherToolControlBar in my SDI frame window. Code looks like this:



int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
    if (CExtNCW < CFrameWnd >::OnCreate(lpCreateStruct) == -1)
        return -1;


    VERIFY( g_CmdManager->ProfileSetup( strMainProfile, GetSafeHwnd() ) );
    VERIFY( g_CmdManager->UpdateFromMenu( strMainProfile, IDR_MAINFRAME ) );


    if (!m_wndMenuBar.Create( _T( "Menubar name" ), this, ID_VIEW_MENUBAR)||
        !m_wndMenuBar.LoadMenuBar(IDR_MAINFRAME))
        return -1;

    m_wndMenuBar.EnableDocking(CBRS_ALIGN_ANY);


    CMenu *menu = m_wndMenuBar.GetMenu();


    if (! m_wndToolBarUiLook.Create( NULL, this, ID_VIEW_UI_LOOK_BAR))
        return -1;

    if (! m_wndToolBarUiLook.ThemeSwitcherInit())    // this fails
        return -1;


    CExtToolControlBar::FrameEnableDocking(this);

    DockControlBar(&m_wndMenuBar);

//    m_wndToolBarUiLook.EnableDocking(CBRS_ALIGN_ANY);
//    DockControlBar(&m_wndToolBarUiLook);



    RecalcLayout();
    return 0;
}

It works in debug build, but m_wndToolBarUiLook.ThemeSwitcherInit() fails in release mode. For debug mode I’m usinf MFC and Prof-uis ad unicode DLL, in release mode all libraries are static unicode. I’ve tried it with prof-uis 2.87 with custom prof-uis.h and with original 2.89, both do the same. In other project which is using MBCS static libraries it works. Do you have idea what could be wrong?


I’ve tried to debug it with 2.87, it was failing at


       	 HINSTANCE hInstResourceCommands =
                g_ResourceManager->FindResourceHandle(
                    RT_TOOLBAR,
                    nToolBarResourceID,
                    NULL,
                    &hRsrcCommands
                    );

with nToolBarResourceID==IDB_EXT_PM_16x16

Technical Support May 21, 2010 - 12:22 PM

Please take a look at any .rc2 file in the res subfolder of any Prof-UIS sample project. You will find lines like these there:

#if ( !(defined _AFXDLL && !defined __STATPROFUIS_WITH_DLLMFC__) )
            #include <Resources/Resource.rc>
#endif

The lines above include Prof-UIS resources into the resources of EXE/DLL modules which are built with Prof-UIS as static library. This lets the Prof-UIS code to load required resources successfully.

Rado Manzela May 24, 2010 - 2:13 AM

Thank you, it helped.