<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : Dll embeded FrameWnd wont load Toolbars</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : Dll embeded FrameWnd wont load Toolbars]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 10 Jun 2026 21:40:06 +0000</pubDate>
  <lastBuildDate>Tue, 29 Sep 2009 07:11:58 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=15051</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[Dll embeded FrameWnd wont load Toolbars :  Hi, I have a similar problem....]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15051&amp;PID=53518&amp;title=dll-embeded-framewnd-wont-load-toolbars#53518</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4289">fjosesen</a><br /><strong>Subject:</strong> 15051<br /><strong>Posted:</strong> 29 September 2009 at 7:11am<br /><br /><DIV><FONT size=2><P>Hi,<BR>&nbsp;&nbsp;&nbsp; I have a similar problem. I need to load two toolbars from different dynamic loaded dlls. Both toolbars have the same id. I call to AfxSetResourceHandle before I call the&nbsp; LoadLibrary for each toolbar. It seems to work but I see that both toolbars are drawn identically (with the same bitmap). How can I solve this problem?</P><P>&nbsp;&nbsp;&nbsp; Thanks in advance,</P><P>FJSen<BR></P></FONT></DIV>]]>
   </description>
   <pubDate>Tue, 29 Sep 2009 07:11:58 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15051&amp;PID=53518&amp;title=dll-embeded-framewnd-wont-load-toolbars#53518</guid>
  </item> 
  <item>
   <title><![CDATA[Dll embeded FrameWnd wont load Toolbars : yes this works better for menus...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15051&amp;PID=52453&amp;title=dll-embeded-framewnd-wont-load-toolbars#52453</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=5354">johnmichael</a><br /><strong>Subject:</strong> 15051<br /><strong>Posted:</strong> 27 August 2009 at 9:21am<br /><br />yes this works better for menus and toolbars and does not affect the rest of the application]]>
   </description>
   <pubDate>Thu, 27 Aug 2009 09:21:36 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15051&amp;PID=52453&amp;title=dll-embeded-framewnd-wont-load-toolbars#52453</guid>
  </item> 
  <item>
   <title><![CDATA[Dll embeded FrameWnd wont load Toolbars : Hello,   With standard Menu...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15051&amp;PID=52437&amp;title=dll-embeded-framewnd-wont-load-toolbars#52437</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 15051<br /><strong>Posted:</strong> 27 August 2009 at 7:20am<br /><br />Hello, <DIV>&nbsp;</DIV><DIV>With standard Menu and toolbar you manually pass instance to your dll - GetHInstance()&nbsp;&nbsp;&nbsp; </DIV><DIV>so how CommandBars should find them ???&nbsp;&nbsp; </DIV><DIV>Just set your dll as default resource insance - <strong>AfxSetResourceHandle(</strong>GetHInstance());</DIV>]]>
   </description>
   <pubDate>Thu, 27 Aug 2009 07:20:37 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15051&amp;PID=52437&amp;title=dll-embeded-framewnd-wont-load-toolbars#52437</guid>
  </item> 
  <item>
   <title><![CDATA[Dll embeded FrameWnd wont load Toolbars : Hello, similar to the menus I...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15051&amp;PID=52430&amp;title=dll-embeded-framewnd-wont-load-toolbars#52430</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=5354">johnmichael</a><br /><strong>Subject:</strong> 15051<br /><strong>Posted:</strong> 27 August 2009 at 4:38am<br /><br />Hello, similar to the menus I have the problem that trying to use th CXTPCommandBars functions for loading menus and toolbars wont work:<br><br>here is the code as I think it should work with codejock CXTPCommandBars<br><br>&lt;code&gt;<br>BOOL CComponentEditorDialog::OnInitDialog()<br>{<br>&nbsp;&nbsp;&nbsp; LoadAccelTable( MAKEINTRESOURCE(IDR_COMPONENT_EDITOR_MENU) );<br><br>&nbsp;&nbsp;&nbsp; CRect rc;<br>&nbsp;&nbsp;&nbsp; GetClientRect( &amp;rc );<br><br>&nbsp;&nbsp;&nbsp; HMENU menu = LoadMenu(GetHInstance(),MAKEINTRESOURCE(IDR_COMPONENT_EDITOR_MENU));<br>&nbsp;&nbsp;&nbsp; CMenu * pMenu = new CMenu();<br>&nbsp;&nbsp;&nbsp; if ( pMenu )<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if ( pMenu-&gt;Attach(menu) )<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TRACE0("success created menu bar\n");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TRACE0("Failed to create menu bar\n");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; try<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (!InitCommandBars())<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return -1;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; catch (CResourceException *e)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; e-&gt;Delete();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return -1;<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; // Get a pointer to the command bars object.<br>&nbsp;&nbsp;&nbsp; CXTPCommandBars* pCommandBars = GetCommandBars();<br>&nbsp;&nbsp;&nbsp; if(pCommandBars == NULL)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TRACE0("Failed to create command bars object.\n");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return -1;<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; CXTPCommandBar * pMenuBar = pCommandBars-&gt;Add(_T("Menu Bar"),xtpBarTop);<br>&nbsp;&nbsp;&nbsp; if ( pMenuBar == NULL )<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TRACE0("Failed to create menu bar\n");<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pMenuBar-&gt;LoadMenu(pMenu);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pMenuBar-&gt;SetFlags(xtpFlagStretched|xtpFlagNoMovable);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pMenuBar-&gt;EnableCustomization(FALSE);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pMenuBar-&gt;SetShowGripper(FALSE);<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; CXTPToolBar *pStdToolBar = pCommandBars-&gt;Add( _T("Component ToolBar"),xtpBarTop );<br>&nbsp;&nbsp;&nbsp; pStdToolBar-&gt;LoadToolBar(IDR_COMPONENT_TOOLBAR); //This fails to load I think because its not using the correct module to load the resource from<br><br>&nbsp;&nbsp;&nbsp; GetDockingPaneManager()-&gt;InstallDockingPanes(this);<br>&nbsp;&nbsp;&nbsp; GetDockingPaneManager()-&gt;SetTheme(xtpPaneThemeOffice2003);<br>&nbsp;&nbsp;&nbsp; GetDockingPaneManager()-&gt;SetThemedFloatingFrames(TRUE);<br>&nbsp;&nbsp;&nbsp; GetDockingPaneManager()-&gt;SetAlphaDockingContext(TRUE);<br>&nbsp;&nbsp;&nbsp; GetDockingPaneManager()-&gt;SetShowDockingContextStickers(TRUE);<br><br>&nbsp;&nbsp;&nbsp; m_componentGraph.Create(WS_CHILD|WS_CLIPCHILDREN|WS_VISIBLE,rc,this,AFX_IDW_PANE_FIRST);<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; return TRUE;<br>}<br>&lt;/code&gt;<br><br><br>here is the code I had to develop to load the menu and toolbars manually. However with the toolbar there is no easy way to convert it to a CXTPToolbar from what I can tell so it is not skinned and looks like a standard windows 9x toolbar:<br><br>&lt;code&gt;<br>BOOL CComponentEditorDialog::OnInitDialog()<br>{<br>&nbsp;&nbsp;&nbsp; LoadAccelTable( MAKEINTRESOURCE(IDR_COMPONENT_EDITOR_MENU) );<br><br>&nbsp;&nbsp;&nbsp; CRect rc;<br>&nbsp;&nbsp;&nbsp; GetClientRect( &amp;rc );<br><br>&nbsp;&nbsp;&nbsp; HMENU menu = LoadMenu(GetHInstance(),MAKEINTRESOURCE(IDR_COMPONENT_EDITOR_MENU));<br>&nbsp;&nbsp;&nbsp; CMenu * pMenu = new CMenu();<br>&nbsp;&nbsp;&nbsp; if ( pMenu )<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if ( pMenu-&gt;Attach(menu) )<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TRACE0("success created menu bar\n");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TRACE0("Failed to create menu bar\n");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; try<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (!InitCommandBars())<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return -1;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; catch (CResourceException *e)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; e-&gt;Delete();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return -1;<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; // Get a pointer to the command bars object.<br>&nbsp;&nbsp;&nbsp; CXTPCommandBars* pCommandBars = GetCommandBars();<br>&nbsp;&nbsp;&nbsp; if(pCommandBars == NULL)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TRACE0("Failed to create command bars object.\n");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return -1;<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; CXTPCommandBar * pMenuBar = pCommandBars-&gt;Add(_T("Menu Bar"),xtpBarTop);<br>&nbsp;&nbsp;&nbsp; if ( pMenuBar == NULL )<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TRACE0("Failed to create menu bar\n");<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pMenuBar-&gt;LoadMenu(pMenu);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pMenuBar-&gt;SetFlags(xtpFlagStretched|xtpFlagNoMovable);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pMenuBar-&gt;EnableCustomization(FALSE);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pMenuBar-&gt;SetShowGripper(FALSE);<br>&nbsp;&nbsp;&nbsp; }<br><br><br>&nbsp;&nbsp;&nbsp; // the following code creates a toolbar adds the command ids to it and then loads its relevant bitmap <br>&nbsp;&nbsp;&nbsp; uint m_ids&#091;ID_COMPONENT_TOOLBAR_END-ID_COMPONENT_TOOLBAR_OPEN&#093;;<br><br>&nbsp;&nbsp;&nbsp; if ( !m_toolbar.CreateEx(this) )<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TRACE0("Failed to create tool bar\n");<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for(int id = 0; id &lt; ID_COMPONENT_TOOLBAR_END-ID_COMPONENT_TOOLBAR_OPEN; id++ )<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; m_ids&#091;id&#093; = ID_COMPONENT_TOOLBAR_OPEN+id;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if ( m_toolbar.SetButtons(m_ids,ID_COMPONENT_TOOLBAR_END-ID_COMPONENT_TOOLBAR_OPEN) )<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if ( !m_toolbar.SetBitmap(LoadBitmap(GetHInstance(),MAKEINTRESOURCE(IDR_COMPONENT_TOOLBAR))) )<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TRACE0("Failed to create bitmap from tool bar\n");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; GetDockingPaneManager()-&gt;InstallDockingPanes(this);<br>&nbsp;&nbsp;&nbsp; GetDockingPaneManager()-&gt;SetTheme(xtpPaneThemeOffice2003);<br>&nbsp;&nbsp;&nbsp; GetDockingPaneManager()-&gt;SetThemedFloatingFrames(TRUE);<br>&nbsp;&nbsp;&nbsp; GetDockingPaneManager()-&gt;SetAlphaDockingContext(TRUE);<br>&nbsp;&nbsp;&nbsp; GetDockingPaneManager()-&gt;SetShowDockingContextStickers(TRUE);<br><br>&nbsp;&nbsp;&nbsp; m_componentGraph.Create(WS_CHILD|WS_CLIPCHILDREN|WS_VISIBLE,rc,this,AFX_IDW_PANE_FIRST);<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; return TRUE;<br>}<br>&lt;/code&gt;<br><br>Again I think this is a bug with the CXTPCommandBars failing to load the resources from the correct Module. Because specifying the module and resource to load manually succeeds. Is there away to convert my manual loading of the resource into a CXTPToolBar so that it gets skinned correctly as with the Menubar?<br><br>regards<br><br>]]>
   </description>
   <pubDate>Thu, 27 Aug 2009 04:38:25 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15051&amp;PID=52430&amp;title=dll-embeded-framewnd-wont-load-toolbars#52430</guid>
  </item> 
 </channel>
</rss>