<?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 : Calling GetActiveDocument from CMainFrame</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : Calling GetActiveDocument from CMainFrame]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sat, 04 Apr 2026 01:57:00 +0000</pubDate>
  <lastBuildDate>Thu, 10 May 2007 09:07:11 +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=7097</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[Calling GetActiveDocument from CMainFrame : oleg,  I&amp;#039;m sorry, but this...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=7097&amp;PID=22749&amp;title=calling-getactivedocument-from-cmainframe#22749</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2972">gpeffers</a><br /><strong>Subject:</strong> 7097<br /><strong>Posted:</strong> 10 May 2007 at 9:07am<br /><br />oleg,<DIV>&nbsp;</DIV><DIV>I'm sorry, but this does not fix it.&nbsp; The document is still returned as NULL even in the Codejock ShortcutBar sample.</DIV><DIV>&nbsp;</DIV><DIV>Just to clarify, what I've done is added a line of code to the standard Codejock ShortcutBar sample as shown below:</DIV><DIV>&nbsp;</DIV><DIV>void CMainFrame::OnCustomize()</DIV><DIV>{</DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>&nbsp; GetActiveFrame()-&gt;GetActiveDocument();</FONT></DIV><DIV>&nbsp;</DIV><DIV><FONT size=2>&nbsp; </FONT><FONT color=#008000><FONT size=2>// get a pointer to the command bars object.</FONT></FONT></DIV><DIV><FONT size=2><FONT color=#008000>&nbsp; </FONT>CXTPCommandBars* pCommandBars = GetCommandBars();</FONT></DIV><DIV><FONT size=2>&nbsp;<FONT color=#0000ff>&nbsp;if</FONT> (pCommandBars == NULL)</FONT></DIV><DIV><DIV><FONT size=2><FONT color=#0000ff>&nbsp;&nbsp;&nbsp; return</FONT>;</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>&nbsp; ...........</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>I've added the code here only as a test to see if I can get the active document once the app is up and running.&nbsp; Inside GetActiveDocument(), the call to GetActiveView() returns NULL and therefore returns NULL for the document as well.</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>I'm not sure if it's ShortcutBar related, but this works fine in other applications.</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>Thanks,</FONT></DIV><DIV><FONT size=2>Glenn</FONT></DIV></DIV>]]>
   </description>
   <pubDate>Thu, 10 May 2007 09:07:11 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=7097&amp;PID=22749&amp;title=calling-getactivedocument-from-cmainframe#22749</guid>
  </item> 
  <item>
   <title><![CDATA[Calling GetActiveDocument from CMainFrame : Hi, if you use MDI its correct...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=7097&amp;PID=22734&amp;title=calling-getactivedocument-from-cmainframe#22734</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 7097<br /><strong>Posted:</strong> 10 May 2007 at 1:29am<br /><br /><DIV>Hi,</DIV><DIV>if you use MDI its correct behavior.</DIV><DIV>&nbsp;</DIV><DIV>call <strong>GetActiveFrame</strong>()-&gt;<FONT size=2>GetActiveDocument() instead.</FONT></DIV>]]>
   </description>
   <pubDate>Thu, 10 May 2007 01:29:29 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=7097&amp;PID=22734&amp;title=calling-getactivedocument-from-cmainframe#22734</guid>
  </item> 
  <item>
   <title><![CDATA[Calling GetActiveDocument from CMainFrame : I&amp;#039;m trying to call GetActiveDocument()...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=7097&amp;PID=22729&amp;title=calling-getactivedocument-from-cmainframe#22729</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2972">gpeffers</a><br /><strong>Subject:</strong> 7097<br /><strong>Posted:</strong> 09 May 2007 at 3:36pm<br /><br />I'm trying to call GetActiveDocument() from within a CMainFrame class derived from <FONT size=2>CXTPFrameWnd, but the call always returns NULL.&nbsp; Tracing into the GetActiveDocument() call, it&nbsp;appears to return NULL&nbsp; because the View is also NULL.<DIV></DIV><DIV></DIV><DIV></DIV><DIV></DIV><DIV></DIV><DIV></DIV><DIV>&nbsp;</DIV><DIV>I'm working on an app using a ShortcutBar.&nbsp; Just to see if I could narrow down the problem, I've taken the Codejock ShortcutBar sample app and added a call to GetActiveDocument() in the <FONT size=2>CMainFrame::OnCustomize member and I still see NULL returned for the document.&nbsp; I chose this member function only because everything should have been completely initialized by the time is was available.</FONT></DIV><DIV>&nbsp;</DIV><DIV>Can anyone give me a clue as to what I'm doing wrong?&nbsp; I'm working with XTP 11.1.0.</DIV><DIV>&nbsp;</DIV><DIV>Thank you,</DIV><DIV>Glenn</DIV><DIV>&nbsp;</DIV></FONT>]]>
   </description>
   <pubDate>Wed, 09 May 2007 15:36:26 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=7097&amp;PID=22729&amp;title=calling-getactivedocument-from-cmainframe#22729</guid>
  </item> 
 </channel>
</rss>