<?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 : Menu via CMultiDocTemplate?</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : Menu via CMultiDocTemplate?]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sat, 04 Apr 2026 03:54:06 +0000</pubDate>
  <lastBuildDate>Fri, 29 Feb 2008 08:34:50 +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=9738</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[Menu via CMultiDocTemplate? : Hi,  Will you please help with...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=9738&amp;PID=31754&amp;title=menu-via-cmultidoctemplate#31754</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2969">Ashok</a><br /><strong>Subject:</strong> 9738<br /><strong>Posted:</strong> 29 February 2008 at 8:34am<br /><br />Hi,<DIV>&nbsp; Will you please help with code. Thanks in advance.</DIV>]]>
   </description>
   <pubDate>Fri, 29 Feb 2008 08:34:50 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=9738&amp;PID=31754&amp;title=menu-via-cmultidoctemplate#31754</guid>
  </item> 
  <item>
   <title><![CDATA[Menu via CMultiDocTemplate? : Hi;  Try CMDIFrameWnd::MDIActivate()....]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=9738&amp;PID=31749&amp;title=menu-via-cmultidoctemplate#31749</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=109">mgampi</a><br /><strong>Subject:</strong> 9738<br /><strong>Posted:</strong> 29 February 2008 at 7:43am<br /><br />Hi;<DIV>&nbsp;</DIV><DIV>Try CMDIFrameWnd::MDIActivate(). I call this when I want to programmatically switch between different open documents. The framework calls the same, when the user clicks into another - not focused&nbsp;- mdi client window.&nbsp;</DIV>]]>
   </description>
   <pubDate>Fri, 29 Feb 2008 07:43:36 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=9738&amp;PID=31749&amp;title=menu-via-cmultidoctemplate#31749</guid>
  </item> 
  <item>
   <title><![CDATA[Menu via CMultiDocTemplate? : Hi, Thanks for the valuable suggestion....]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=9738&amp;PID=31742&amp;title=menu-via-cmultidoctemplate#31742</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2969">Ashok</a><br /><strong>Subject:</strong> 9738<br /><strong>Posted:</strong> 29 February 2008 at 7:17am<br /><br />Hi, Thanks for the valuable suggestion. That's all right the OpenNewDocument will display the right menu for the current view. My question is if both the views are already opened, when I am toggle between one view to another view I want to change the menu. how?]]>
   </description>
   <pubDate>Fri, 29 Feb 2008 07:17:55 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=9738&amp;PID=31742&amp;title=menu-via-cmultidoctemplate#31742</guid>
  </item> 
  <item>
   <title><![CDATA[Menu via CMultiDocTemplate? : Hi Ashok;   In our project we...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=9738&amp;PID=31737&amp;title=menu-via-cmultidoctemplate#31737</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=109">mgampi</a><br /><strong>Subject:</strong> 9738<br /><strong>Posted:</strong> 29 February 2008 at 3:59am<br /><br />Hi Ashok; <DIV>&nbsp;</DIV><DIV>In our project we have about 15 different document types and each document has its own menu resource. In InitInstance we call CDocManager::AddDocTemplate(). Thats it; the framework switches the menu resources according to the active document type.</DIV><DIV>&nbsp;</DIV><FONT size=2><DIV><FONT face="Courier New, Courier, mono">pDocTemplate = </FONT></FONT><FONT face="Courier New, Courier, mono"><FONT color=#0000ff size=2>new</FONT><FONT size=2> CMultiDocTemplate(IDR_STANDARDTRENDTYPE,</FONT></FONT></DIV><DIV><FONT face="Courier New, Courier, mono" size=2>RUNTIME_CLASS(CTrendDoc),</FONT></DIV><DIV><FONT face="Courier New, Courier, mono" size=2>RUNTIME_CLASS(CTrendFrame), </FONT></DIV><DIV><FONT face="Courier New, Courier, mono"><FONT size=2>RUNTIME_CLASS(CTrendView)); </FONT><FONT color=#008000 size=2>// Trend document type</FONT></FONT></DIV><DIV><FONT face="Courier New, Courier, mono">&nbsp;</FONT></DIV><DIV><FONT face="Courier New, Courier, mono" size=2>AddDocTemplate(pDocTemplate);</FONT><FONT color=#008000 size=2></FONT></DIV><DIV><FONT size=2></FONT><FONT face="Courier New, Courier, mono">&nbsp;</FONT></DIV><DIV><FONT face="Courier New, Courier, mono"><FONT size=2>pDocTemplate = </FONT><FONT color=#0000ff size=2>new</FONT></FONT><FONT size=2><FONT face="Courier New, Courier, mono"> CMultiDocTemplate(IDR_PHASETYPE,</FONT></DIV><DIV><FONT face="Courier New, Courier, mono">RUNTIME_CLASS(CPhaseDoc),</FONT></DIV><DIV><FONT face="Courier New, Courier, mono">RUNTIME_CLASS(CPhaseFrame), </FONT></DIV><DIV><FONT face="Courier New, Courier, mono">RUNTIME_CLASS(CPhaseView));</FONT></DIV><P><FONT face="Courier New, Courier, mono">AddDocTemplate(pDocTemplate);&nbsp; // Another template type</FONT></P><DIV></DIV><P>IDR_STANDARDTRENDTYPE and IDR_PHASETYPE are resource IDs (icon and menu).</P><DIV></DIV>Normally when you add more than one document template to CDocManager, a dialog appears whenever a new document has to be created. To prevent this dialog from showing, you have to&nbsp;create your own&nbsp;OpenNewDocument() function like this: <DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT face="Courier New, Courier, mono"><FONT size=2>CDocument* CXRVisualizerApp::OpenNewDocument(</FONT><FONT color=#0000ff size=2>const</FONT><FONT size=2> CString &amp;strTarget){</FONT></FONT></DIV><DIV><FONT face="Courier New, Courier, mono" size=2>CString strDocName;</FONT></DIV><DIV><FONT face="Courier New, Courier, mono" size=2>CDocTemplate* pSelectedTemplate;</FONT></DIV><DIV><FONT face="Courier New, Courier, mono" size=2>CWaitCursor Wait;</FONT></DIV><DIV><FONT face="Courier New, Courier, mono" size=2>POSITION pos = GetFirstDocTemplatePosition();</FONT></DIV><DIV><FONT face="Courier New, Courier, mono">&nbsp;</FONT></DIV><DIV><FONT face="Courier New, Courier, mono"><FONT color=#0000ff size=2>&nbsp;&nbsp; while</FONT><FONT size=2> (pos != NULL)</FONT></FONT></DIV><DIV><FONT face="Courier New, Courier, mono" size=2>&nbsp;&nbsp; {</FONT></DIV><DIV><FONT face="Courier New, Courier, mono" size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pSelectedTemplate = (CDocTemplate*)GetNextDocTemplate(pos);</FONT></DIV><DIV><FONT face="Courier New, Courier, mono" size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ASSERT(pSelectedTemplate != NULL);</FONT></DIV><DIV><FONT face="Courier New, Courier, mono" size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ASSERT(pSelectedTemplate-&gt;IsKindOf(RUNTIME_CLASS(CDocTemplate)));</FONT></DIV><DIV><FONT face="Courier New, Courier, mono" size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pSelectedTemplate-&gt;GetDocString(strDocName, CDocTemplate::docName);</FONT></DIV><DIV><FONT face="Courier New, Courier, mono">&nbsp;</FONT></DIV><DIV><FONT face="Courier New, Courier, mono"><FONT color=#0000ff size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if</FONT><FONT size=2> (!strDocName.IsEmpty() &amp;&amp; (strDocName == strTarget))</FONT></FONT></DIV><DIV><FONT face="Courier New, Courier, mono" size=2>&nbsp;&nbsp; &nbsp;&nbsp; {</FONT></DIV><DIV><FONT face="Courier New, Courier, mono" size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDocument* pDoc=pSelectedTemplate-&gt;OpenDocumentFile(NULL);</FONT></DIV><DIV><FONT face="Courier New, Courier, mono">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT color=#0000ff size=2>return</FONT><FONT size=2> pDoc; </FONT><FONT color=#008000 size=2>// Success</FONT></FONT></DIV><DIV><FONT face="Courier New, Courier, mono"><FONT color=#008000>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT><FONT size=2>}</FONT></FONT></DIV><DIV><FONT face="Courier New, Courier, mono" size=2>&nbsp;&nbsp; }</FONT></DIV><DIV><FONT face="Courier New, Courier, mono">&nbsp;</FONT></DIV><DIV><FONT face="Courier New, Courier, mono">&nbsp;&nbsp; <FONT color=#0000ff size=2>return</FONT><FONT size=2> NULL; </FONT><FONT color=#008000 size=2>// Failure</FONT></FONT></DIV><DIV><FONT face="Courier New, Courier, mono" size=2>}</FONT></DIV><DIV><FONT face="Courier New"></FONT>&nbsp;</DIV><DIV><FONT face="Verdana, Arial, Helvetica, sans-serif">Then, when you have to create a new document, call this function in your OnNewMyDocument() command handler.</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>Hope this helps.</DIV></FONT></FONT>]]>
   </description>
   <pubDate>Fri, 29 Feb 2008 03:59:02 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=9738&amp;PID=31737&amp;title=menu-via-cmultidoctemplate#31737</guid>
  </item> 
  <item>
   <title><![CDATA[Menu via CMultiDocTemplate? : Hi, I have multiple views in my...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=9738&amp;PID=31732&amp;title=menu-via-cmultidoctemplate#31732</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2969">Ashok</a><br /><strong>Subject:</strong> 9738<br /><strong>Posted:</strong> 29 February 2008 at 2:36am<br /><br />Hi, I have multiple views in my application, How can I show different menu for different view. For example, If I activate one view I have to display one menu. If I activate another view I have to show another menu.<DIV>&nbsp;</DIV><DIV>I have a tree view like this in my application:</DIV><DIV>&nbsp;</DIV><DIV>+Folder</DIV><DIV>&nbsp; +Section1</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MyWorksheet</DIV><DIV>&nbsp; +Section2</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Excel</DIV><DIV>&nbsp;</DIV><DIV>I have 2 Menu resources: IDR_MAIN_MENU for MyWorksheet view&nbsp;, IDR_EXCEL_MENU for Excel view</DIV><DIV>&nbsp;</DIV><DIV>If I open the MyWorksheet(double click).It should display that view menu in the menu bar.</DIV><DIV><DIV>If I open the Excel(double click).It should display that view menu in the menu bar.</DIV><DIV>&nbsp;</DIV><DIV>In my old application(without ToolkitPro)&nbsp;it is working fine because they are calling OnUpdateFrameMenu().</DIV><DIV>How can I do in my current application by getting the DocTemplate Menu. Please Help.</DIV></DIV>]]>
   </description>
   <pubDate>Fri, 29 Feb 2008 02:36:44 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=9738&amp;PID=31732&amp;title=menu-via-cmultidoctemplate#31732</guid>
  </item> 
 </channel>
</rss>