Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with save on CTreeView view when variable is > 0;

Status
Not open for further replies.

elfanddot

Programmer
Feb 21, 2002
28
US
The program uses multiple view class' with one document class. The views are changed with menu options.
When i add some elements to the document and open the Tree view, every thing is fine. When i add more than one of a certain element everything is fine. When i save everything is fine, unless the document has been opened (not the oninit document, untitled). When i open a document, and change to the treeview, everything is fine. When i save the document, even without changing it there is a problem.

The debug points to the expression:
<code>ASSERT(pOb->GetRuntimeClass());<-----
CRuntimeClass *pClassRef=pOb->GetRuntimeClass();<w/o assert
</code>
also points to:
<code>ins byte ptr [dei],dx
or byte ptr [edx], al
pop ecx
add byte ptr [eax], al
add byte ptr [eax], cl
add byte ptr [eax], al
add byte ptr [eax], al
add byte ptr [eax+eax], al <-------------
add byte ptr [eax], al
arpl word ptr [eax,eax],ax
std
</code>
the serialize
<code>
document::serialize(CArchive *ar)
if(isStoring)
{

}
else
{

}
CClass.serialize(ar)
</code>
<code>
CClass::serialize(CArchive *ar)
{if(isStoring)
{ ar << number;
}
else
{ ar >> number;
}
}
</code>
I was messing around with the serializing code and the arrays, CClass is a CObArray, yet when i remove this code, not related to the serializing, the error wasn't there.
<code>
..in CTreeView().OnInitialUpdate()
if(pDoc->CClass.number>0)
{
for (int a=0;a<pDoc->CClass.number;a++)
{
CClass* pClass = new CClass;
pClass = (CClass*)pDoc->Cother.Pages.GetAt(a);
...title=gettitle();
hproject=tree.InsertItem(title,hroot);
delete pClass;
}}
</code>
the error only occurs when pDoc->CClass.number>1
when a saved file has been opened, and when the treeview has been shown.

also when error occurrs, occasionally the program remains active on the system, yet not as a window, and causes assert notifications. this happens after the program has closed and awhile latter. Didn't find out why until ctrl+alt+del. the program is an active server,container,with automation.



thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top