<?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 : CXTPControl causing CArchiveException</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : CXTPControl causing CArchiveException]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Mon, 20 Apr 2026 07:00:15 +0000</pubDate>
  <lastBuildDate>Fri, 17 May 2013 07:06:06 +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=21649</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[CXTPControl causing CArchiveException : HiI&amp;#039;ve been making a patch...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=21649&amp;PID=70948&amp;title=cxtpcontrol-causing-carchiveexception#70948</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=5354">johnmichael</a><br /><strong>Subject:</strong> 21649<br /><strong>Posted:</strong> 17 May 2013 at 7:06am<br /><br />Hi<div><br></div><div>I've been making a patch to following function:</div><div><br></div><blockquote style="margin: 0 0 0 40px; border: n&#111;ne; padding: 0px;"><div>void CXTPControl::DoPropExchange(CXTPPropExchange* pPX)</div></blockquote><div><br></div><div>I created a new Schema version and set it to the current version in&nbsp;<span style="line-height: 1.4;">XTPPropExchange.inc</span></div><div><br><div>...</div></div><blockquote style="margin: 0 0 0 40px; border: n&#111;ne; padding: 0px;"><div><div>#define _XTP_SCHEMA_1350 (0x26)</div></div><div><div><br></div></div><div><div><br></div></div><div><div>#define _XTP_SCHEMA_CURRENT _XTP_SCHEMA_1350</div></div></blockquote><div>....</div><div><br></div><div>Inside the DoPropExchange function I added:<br><br>...</div><div><br></div><blockquote style="margin: 0 0 0 40px; border: n&#111;ne; padding: 0px;"><div><div><span ="Apple-tab-span" style="white-space:pre">	</span>if (pPX-&gt;GetSchema() &gt; _XTP_SCHEMA_1340)</div></div><div><div><span ="Apple-tab-span" style="white-space:pre">	</span>{</div></div><div><div><span ="Apple-tab-span" style="white-space:pre">		</span>if ( pPX-&gt;IsStoring() )</div></div><div><div><span ="Apple-tab-span" style="white-space:pre">		</span>{</div></div><div><div><span ="Apple-tab-span" style="white-space:pre">			</span>XTP_SHORTCUTMANAGER_ACCEL command;</div></div><div><div><span ="Apple-tab-span" style="white-space:pre">			</span>command.cmd = m_nId;</div></div><div><div><span ="Apple-tab-span" style="white-space:pre">			</span>pCommandBars-&gt;GetShortcutManager()-&gt;ResolveCommand(&amp;command,true);</div></div><div><div><span ="Apple-tab-span" style="white-space:pre">			</span>CString idstr(command.cmd_name);</div></div><div><div><span ="Apple-tab-span" style="white-space:pre">			</span>PX_String(pPX, _T("ID_TAG"), idstr, _T(""));</div></div><div><div><span ="Apple-tab-span" style="white-space:pre">		</span>}</div></div><div><div><span ="Apple-tab-span" style="white-space:pre">		</span>else if (pPX-&gt;IsLoading())</div></div><div><div><span ="Apple-tab-span" style="white-space:pre">		</span>{</div></div><div><div><span ="Apple-tab-span" style="white-space:pre">			</span>CString idstr;</div></div><div><div><span ="Apple-tab-span" style="white-space:pre">			</span>PX_String(pPX, _T("ID_TAG"), idstr, _T(""));</div></div><div><div><span ="Apple-tab-span" style="white-space:pre">			</span>XTP_SHORTCUTMANAGER_ACCEL command;</div></div><div><div><span ="Apple-tab-span" style="white-space:pre">			</span>_snprintf(command.cmd_name,sizeof(command.cmd_name),"%s",idstr);</div></div><div><div><span ="Apple-tab-span" style="white-space:pre">			</span>pCommandBars-&gt;GetShortcutManager()-&gt;ResolveCommand(&amp;command,false);</div></div><div><div><span ="Apple-tab-span" style="white-space:pre">			</span>m_nId = command.cmd;</div></div><div><div><span ="Apple-tab-span" style="white-space:pre">		</span>}</div></div><div><div><span ="Apple-tab-span" style="white-space:pre">	</span>}</div></div></blockquote><span style="line-height: 1.4;">...</span><div><span style="line-height: 1.4;"><br></span></div><div><span style="line-height: 1.4;"><br></span></div><div><span style="line-height: 1.4;">The idea being that storing the numerical number for id is pretty bad since the resource.h file that these ids are defined in can change underneath the toolkit invalidating the registry. So instead I look up and store the actual string tag name, and resolve that back into / from the ID when saving and loading.</span></div><div><span style="line-height: 1.4;"><br></span></div><div><span style="line-height: 1.4;">However, despite adding a new schema for my specific change I am now getting</span><br><br>CArchiveException thrown, and caught the cause parameter indicates 'badindex'. However I placed breakpoints on everywhere in the xt code I could find the CArchiveException being thrown and I could not find anywhere it was being thrown. Looks like its coming from within microsofts platform libraries.</div><div><br></div><div>Any help / better understanding on what I could be doing wrong would be great.</div><div><br></div><div>I've debugged my new parameter and it is indeed being resolved correctly. to the string and vice versa. However I cannot check the registry values because they appear to be a compressed byte stream of the objects serialised. This is making it all very hard to debug and understand what has gone wrong.</div><div><br></div><div>The only thing I can think off is that I've exceeded some capacity limit on the amount of data the control object can serialize however that seems a rather arbitrary reason.</div><div><br></div><div>Has anyone got any experience with this?</div><div><br></div><div>Many thanks</div><div>Jm</div>]]>
   </description>
   <pubDate>Fri, 17 May 2013 07:06:06 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=21649&amp;PID=70948&amp;title=cxtpcontrol-causing-carchiveexception#70948</guid>
  </item> 
 </channel>
</rss>