Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Serialing CObArrays in VC++

Status
Not open for further replies.

mehrara

Newbie level 6
Joined
Oct 28, 2003
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
135
Hi
I have declared a CObArray in the document of a SDI program. this array contains object which have another cobarray for themselves. Parent of both of these objecs is CButton class. When I want to Serialize the objects I call the first CObArray Serialize in the Serialize of the Document class and the Serialize of the second array in the first object's Serialize. For the first one it works but when it comes to loading the second CobArray during the run time the program halts with the following error : Unhandled exception at 0x7c208a9b (mfc70d.dll) in Design.exe: User breakpoint.
Does anyone has any ideas?

p.s following is the code which I wrote for both Serialize functions:
{

char str[20];
CRect r;

if(ar.IsStoring()){
GetWindowRect(&r); CurrentView->ScreenToClient(&r);
// ar << r;
GetWindowText(str,sizeof(str)-1);
ar << str;

}
else{

ar >> r;
ar >> str;
SetWindowText(str);
SetWindowPos(NULL,r.left,r.top,r.right-r.left,r.bottom-r.top,SWP_NOZORDER);
}
}
 

why
// r << r;
is in comment ?

I suggest you to use

CString instead of char[20]

this should help to avoid problems
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top