Print Page | Close Window

Loading Designer CommandBars from DLLs

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=13786
Printed Date: 28 February 2025 at 4:19am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Loading Designer CommandBars from DLLs
Posted By: voripteth
Subject: Loading Designer CommandBars from DLLs
Date Posted: 24 March 2009 at 5:45pm
My app loads some of it's menus and toolbars from DLLs.  How do I load Designer created elements (CommandBars and Menus) from various DLL locations? 

I looked at your Scribble example but it seems to load the entire UI from a DLL.  My app needs to add elements to an exisitng UI.  This would include inserting CommandBars to specific positions in the existing UI.

Thanks for your help!



-------------
Product: ToolkitPro (MFC) v13.0.0
Platform: Windows XP(32bit)-SP 3
Language: VC++ 2008



Replies:
Posted By: Oleg
Date Posted: 25 March 2009 at 2:19am
Hi,
 
With designer file you can load only whole commandbars.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Smucker
Date Posted: 25 March 2009 at 4:03am
You can copy toolbars around between loaded commandbars, though.

I had a similar issue: I wanted to use one designer file and share icons and commands between the command bar and some toolbars located elsewhere, so maybe this will help you:

Adds a toolbar from a designer-loadded commandbar to a CWnd-derived object (CTreePane). Error handling omitted for clarity

void CTreePane::OnSize(UINT nType, int cx, int cy)
{
    CWnd::OnSize(nType, cx, cy);
    if (!m_toolscopied) {
        CMainFrame *pframe = (CMainFrame *)AfxGetMainWnd();
        CXTPCommandBars *pcmdbars = pframe->GetCommandBars();
        CXTPToolBar *ptbar = pcmdbars->GetToolBar(TBR_TREE);
        CXTPControls *pcontrols = ptbar->GetControls()->Duplicate(TRUE);
        m_toolbar.SetControls(pcontrols);
        m_toolscopied = TRUE;
        m_toolbar.EnableDocking(xtpFlagAlignTop|xtpFlagHideWrap|xtpFlagStretched);
     }
//...



-------------
Product: Xtreme Toolkit Pro version 13.2 (Unicode, static build)

Platform: Windows 200x/XP/Vista/Win7 (32/64 bit)

Language: Visual C++ 9.0 (Studio 2008)




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net