Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Loading Designer CommandBars from DLLs
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Loading Designer CommandBars from DLLs

 Post Reply Post Reply
Author
Message
voripteth View Drop Down
Newbie
Newbie
Avatar

Joined: 24 March 2009
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote voripteth Quote  Post ReplyReply Direct Link To This Post Topic: Loading Designer CommandBars from DLLs
    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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 25 March 2009 at 2:19am
Hi,
 
With designer file you can load only whole commandbars.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Smucker View Drop Down
Senior Member
Senior Member
Avatar

Joined: 02 February 2008
Status: Offline
Points: 156
Post Options Post Options   Thanks (0) Thanks(0)   Quote Smucker Quote  Post ReplyReply Direct Link To This Post 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)

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.063 seconds.