<?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 : CArchive, bad index?!</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Report Control : CArchive, bad index?!]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sat, 18 Apr 2026 05:21:41 +0000</pubDate>
  <lastBuildDate>Thu, 07 Feb 2008 14:42:53 +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=9519</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[CArchive, bad index?! : Ok, solved it. It turned out the...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=9519&amp;PID=30939&amp;title=carchive-bad-index#30939</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2198">znakeeye</a><br /><strong>Subject:</strong> 9519<br /><strong>Posted:</strong> 07 February 2008 at 2:42pm<br /><br />Ok, solved it. It turned out the code copied from the report sample had a minor error in it:<DIV><FONT color=#040004 size=2></FONT>&nbsp;</DIV><DIV><FONT color=#040004 size=2>IMPLEMENT_SERIAL</FONT><FONT size=2>(</FONT><FONT color=#040004 size=2>CMyRecord</FONT><FONT size=2>, </FONT><FONT color=#040004 size=2>CXTPReportRecord</FONT><FONT size=2>, </FONT><FONT color=#040004 size=2>0</FONT><FONT size=2>)</FONT></DIV><DIV><FONT size=2>should be:</FONT></DIV><DIV><FONT size=2><DIV><FONT color=#040004 size=2>IMPLEMENT_SERIAL</FONT><FONT size=2>(</FONT><FONT color=#040004 size=2>CMyRecord</FONT><FONT size=2>, </FONT><FONT color=#040004 size=2>CXTPReportRecord</FONT><FONT size=2>, </FONT><FONT color=#040004 size=2>VERSIONABLE_SCHEMA</FONT><FONT size=2> | </FONT><FONT color=#040004 size=2>_XTP_SCHEMA_CURRENT</FONT><FONT size=2>)</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>Quite amazing how such a small mistake can cause such hard-to-find errors.</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>Anyway, now I can drop my records on my tree control! \o/</DIV></FONT></DIV></FONT>]]>
   </description>
   <pubDate>Thu, 07 Feb 2008 14:42:53 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=9519&amp;PID=30939&amp;title=carchive-bad-index#30939</guid>
  </item> 
  <item>
   <title><![CDATA[CArchive, bad index?! : This code was copied from CXTPReportControl::Paste....]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=9519&amp;PID=30929&amp;title=carchive-bad-index#30929</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2198">znakeeye</a><br /><strong>Subject:</strong> 9519<br /><strong>Posted:</strong> 07 February 2008 at 10:38am<br /><br />This code was copied from CXTPReportControl::Paste. I really can't understand why it won't work for N&gt;1 items.<DIV>&nbsp;</DIV><DIV>Please help me out.</DIV>]]>
   </description>
   <pubDate>Thu, 07 Feb 2008 10:38:33 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=9519&amp;PID=30929&amp;title=carchive-bad-index#30929</guid>
  </item> 
  <item>
   <title><![CDATA[CArchive, bad index?! : Hi,  I have derived from CXTTreeCtrl...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=9519&amp;PID=30890&amp;title=carchive-bad-index#30890</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2198">znakeeye</a><br /><strong>Subject:</strong> 9519<br /><strong>Posted:</strong> 06 February 2008 at 8:36pm<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>I have derived from CXTTreeCtrl and COleDropTarget. Then I registered a clipboard format in my report control and catch it in CMyTreeCtrl::OnDrop. Dragging ONE row from the report control succeeds, but when dragging multiple rows, the second one causes an exception at the call to PX_Object (CArchiveException::badIndex).</DIV><DIV>&nbsp;</DIV><DIV>What am I doing wrong?</DIV><DIV>&nbsp;</DIV><DIV>BOOL CMyTreeCtrl::OnDrop(CWnd* pWnd, COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point)<BR>{<BR>&nbsp;if (!pDataObject-&gt;IsDataAvailable(m_cfFormat))<BR>&nbsp;&nbsp;return FALSE;<BR>&nbsp;<BR>&nbsp;CFile* pFile = pDataObject-&gt;GetFileData(m_cfFormat);<BR>&nbsp;if (!pFile)<BR>&nbsp;&nbsp;return FALSE;</DIV><DIV>&nbsp;CXTPReportRecords arRecords;<BR>&nbsp;CArchive ar(pFile, CArchive::load);<BR>&nbsp;<BR>&nbsp;try<BR>&nbsp;{<BR>&nbsp;&nbsp;CXTPPropExchangeArchive px(ar);<BR>&nbsp;<BR>&nbsp;&nbsp;CXTPPropExchangeSection secRecords(px.GetSection(_T("ReportRecords")));<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;long nSchema = 0;<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;PX_Long(&amp;px, _T("Version"), (long&amp;)nSchema);<BR>&nbsp;&nbsp;px.ExchangeLocale();<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;CXTPPropExchangeEnumeratorPtr pEnumRecords(secRecords-&gt;GetEnumerator(_T("Record")));<BR>&nbsp;&nbsp;POSITION posRecord = pEnumRecords-&gt;GetPosition();</DIV><DIV>&nbsp;&nbsp;while (posRecord)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;CXTPPropExchangeSection secRecord(pEnumRecords-&gt;GetNext(posRecord));<BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;CXTPReportRecord* pRecord = NULL;<BR>&nbsp;&nbsp;&nbsp;<strong>PX_Object</strong>(&amp;secRecord, pRecord, RUNTIME_CLASS(CXTPReportRecord));<BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;if (!pRecord)<BR>&nbsp;&nbsp;&nbsp;&nbsp;AfxThrowArchiveException(CArchiveException::badClass);<BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;CMyIndexRecordItem *pItem = DYNAMIC_DOWNCAST(CMyIndexRecordItem, pRecord-&gt;GetItem(1));<BR>&nbsp;&nbsp;&nbsp;if (pItem)<BR>&nbsp;&nbsp;&nbsp;&nbsp;InsertItem(pItem-&gt;GetValue());</DIV><DIV>&nbsp;&nbsp;&nbsp;CMDTARGET_RELEASE(pRecord);<BR>&nbsp;&nbsp;}<BR>&nbsp;}<BR>&nbsp;catch (CArchiveException* pE)<BR>&nbsp;{<BR>&nbsp;&nbsp;pE-&gt;Delete();<BR>&nbsp;}<BR>&nbsp;catch (CFileException* pE)<BR>&nbsp;{<BR>&nbsp;&nbsp;pE-&gt;Delete();<BR>&nbsp;}<BR>&nbsp;catch (...)<BR>&nbsp;{<BR>&nbsp;}<BR>&nbsp;<BR>&nbsp;ar.Close();<BR>&nbsp;delete pFile;<BR>&nbsp;<BR>&nbsp;return TRUE;<BR>}</DIV>]]>
   </description>
   <pubDate>Wed, 06 Feb 2008 20:36:35 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=9519&amp;PID=30890&amp;title=carchive-bad-index#30890</guid>
  </item> 
 </channel>
</rss>