Click here to Skip to main content
15,886,664 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionUse CFileDialog and get Unicode filenames in a Multi-Byte project Pin
manchukuo23-Jul-09 18:00
manchukuo23-Jul-09 18:00 
AnswerRe: Use CFileDialog and get Unicode filenames in a Multi-Byte project Pin
Kushagra Tiwari23-Jul-09 21:07
Kushagra Tiwari23-Jul-09 21:07 
GeneralRe: Use CFileDialog and get Unicode filenames in a Multi-Byte project Pin
manchukuo24-Jul-09 4:31
manchukuo24-Jul-09 4:31 
QuestionTitleBar Pin
kumar sanghvi23-Jul-09 17:20
kumar sanghvi23-Jul-09 17:20 
AnswerRe: TitleBar Pin
Mahesh Kulkarni23-Jul-09 20:57
Mahesh Kulkarni23-Jul-09 20:57 
GeneralRe: TitleBar Pin
kumar sanghvi24-Jul-09 0:51
kumar sanghvi24-Jul-09 0:51 
QuestionI am not able to get WM_GETMINMAXINFO Message in CDockablePane derived control. Please Help Me! Pin
jeet51123-Jul-09 15:59
jeet51123-Jul-09 15:59 
QuestionSerialize Linked List Pin
Esaias Pech23-Jul-09 15:32
Esaias Pech23-Jul-09 15:32 
I made a list of points:

class CPuntoList : public CObject
{

public:
	CPunto* raiz;
	CPuntoList();
	void Inserta(CPunto* nodo);
	virtual ~CPuntoList();
	virtual void Serialize(CArchive &ar);
	long getSize();
}


The serialize function of the List looks like this:
void CPuntoList::Serialize(CArchive &ar)
{
	CObject::Serialize(ar);
	long i;
	if(ar.IsStoring())
	{
		ar<<raiz;
	}
	else
	{
	        ar>>raiz;
	}
}


the Punto Class looks like this:

class CPunto : public CObject
{
public:
	CPunto();
	CPunto(double _x, double _y, double _z, double _zTn);
	CPunto *m_pSigPunto;	//	Pointer to the next point
	CGLColor *m_pColor;
	void Inicializa();
	virtual ~CPunto();
	virtual void Serialize(CArchive& ar);
public:
	double x, y, z, zTn;
private:
	DECLARE_SERIAL(CPunto)
};


Serialize functino looks like this:

void CPunto::Serialize(CArchive &ar)
{
	CString str;
	
	if(ar.IsStoring())
	{
		ar<<x;
		ar<<y;
		ar<<z;
		ar<<zTn;
		ar<<m_pColor;
		ar<<m_pSigPunto;	//	Pointer to next point (Linked list)
	}
	else
	{
		ar>>x;
		ar>>y;
		ar>>z;
		ar>>zTn;
		ar>>m_pColor;
		ar>>m_pSigPunto;	//	Pointer to next point (Linked list)
	}	
}	



Now the question is:
When I load about 200 points to the list or even 5,000 points and I save the data to a file using the serialize functions everything works fine, both the storing and the loading.
But when I try to save about 12,000 points, there is an error in both storing and loading, it says "Stack overflow."
I think because from one function (the serialize function) I call the a serialize function over and over so the Stack overflows...
Is that the problem? or what could be the issue? anyways, more importantly, how can I solve it??

Please help!!!!
AnswerRe: Serialize Linked List Pin
KarstenK23-Jul-09 21:24
mveKarstenK23-Jul-09 21:24 
AnswerRe: Serialize Linked List Pin
killabyte24-Jul-09 0:22
killabyte24-Jul-09 0:22 
GeneralStructure Pin
resolvequestion23-Jul-09 12:20
resolvequestion23-Jul-09 12:20 
GeneralRe: Structure Pin
killabyte23-Jul-09 13:51
killabyte23-Jul-09 13:51 
QuestionActive Document Server Menu question. Pin
ancere23-Jul-09 9:14
ancere23-Jul-09 9:14 
AnswerRe: Active Document Server Menu question. Pin
transoft23-Jul-09 9:18
transoft23-Jul-09 9:18 
GeneralRe: Active Document Server Menu question. Pin
ancere24-Jul-09 3:19
ancere24-Jul-09 3:19 
Questionmouse cursor not shown in the CScrollView Pin
transoft23-Jul-09 8:38
transoft23-Jul-09 8:38 
AnswerRe: mouse cursor not shown in the CScrollView Pin
Iain Clarke, Warrior Programmer23-Jul-09 9:03
Iain Clarke, Warrior Programmer23-Jul-09 9:03 
GeneralRe: mouse cursor not shown in the CScrollView Pin
transoft23-Jul-09 9:17
transoft23-Jul-09 9:17 
GeneralRe: mouse cursor not shown in the CScrollView Pin
Iain Clarke, Warrior Programmer23-Jul-09 9:26
Iain Clarke, Warrior Programmer23-Jul-09 9:26 
GeneralRe: mouse cursor not shown in the CScrollView Pin
transoft23-Jul-09 10:09
transoft23-Jul-09 10:09 
QuestionUsing vista's virtualisation Pin
Kees195823-Jul-09 7:25
Kees195823-Jul-09 7:25 
QuestionBit Shift and Mask Pin
resolvequestion23-Jul-09 6:29
resolvequestion23-Jul-09 6:29 
AnswerRe: Bit Shift and Mask Pin
Cedric Moonen23-Jul-09 7:40
Cedric Moonen23-Jul-09 7:40 
AnswerRe: Bit Shift and Mask Pin
Iain Clarke, Warrior Programmer23-Jul-09 9:17
Iain Clarke, Warrior Programmer23-Jul-09 9:17 
GeneralRe: Bit Shift and Mask Pin
resolvequestion23-Jul-09 9:59
resolvequestion23-Jul-09 9:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.