Click here to Skip to main content
15,893,564 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Weird situation with WinSock Pin
David Crow9-Nov-09 3:20
David Crow9-Nov-09 3:20 
Questionwin32 prog Pin
himmi20097-Nov-09 16:40
himmi20097-Nov-09 16:40 
GeneralRe: win32 prog Pin
himmi20097-Nov-09 16:41
himmi20097-Nov-09 16:41 
AnswerRe: win32 prog Pin
«_Superman_»7-Nov-09 18:38
professional«_Superman_»7-Nov-09 18:38 
AnswerRe: win32 prog Pin
himmi20098-Nov-09 4:17
himmi20098-Nov-09 4:17 
GeneralRe: win32 prog Pin
«_Superman_»8-Nov-09 6:13
professional«_Superman_»8-Nov-09 6:13 
QuestionRe: win32 prog Pin
David Crow9-Nov-09 3:23
David Crow9-Nov-09 3:23 
QuestionSerialization from a CPropertypage class behaves differently [modified] Pin
al25007-Nov-09 14:18
al25007-Nov-09 14:18 
Hi,

I have successfully implemented serialization of various collection classes even when the data contained CStrings so I'm very familiar with the requirements.

However, I have attempted to serialize a CArray <myclass, myclass&=""> MyCArray from a CPropertyPage class (to save various page defaults) and I noticed that the following serialize overrides are never executed when MyCArray.Serialize(archive) is called and CStrings recovered from the archive are either empty or have a bad pointer. Integers recovered from the archive are correct.


CMyClass : public CObject
{
DECLARE_SERIAL(CMyClass)
public:
//various variables here
void Serialize(CArchive& ar);
....
}

class CMyPage : public CPropertyPage
{
DECLARE_DYNAMIC(CMyPage)
public:

CArray < CMyClass, CMYClass& > MyArray; 

.....

}



MyClass::Serialize(CArchive& ar) //this routine never executed
{
//the usual << and >> operators here
}

and 

template <> void AFXAPI SerializeElements < CMYClass > (.....) //this routine never executed



Assuming there no's easy fix, is there another simple method could I use to save a small amount of default data to disk (integers and CStrings). I'm just trying to allow the user to save the various property page settings so they do not have to enter them each time.

Thanks

P.S. What's really strange and really frustrating is that on another property page I have a CArray < CString, CString& > MYStringArray and it serializes correctly! Could CPropertyPages have it's own Serialize function ?

modified on Saturday, November 7, 2009 9:12 PM

AnswerRe: Serialization from a CPropertypage class behaves differently Pin
«_Superman_»7-Nov-09 18:41
professional«_Superman_»7-Nov-09 18:41 
GeneralRe: Serialization from a CPropertypage class behaves differently [modified] Pin
al25008-Nov-09 8:04
al25008-Nov-09 8:04 
QuestionBeginner question using headers Pin
Jacob Dixon7-Nov-09 10:49
Jacob Dixon7-Nov-09 10:49 
AnswerRe: Beginner question using headers Pin
Jacob Dixon7-Nov-09 10:53
Jacob Dixon7-Nov-09 10:53 
GeneralRe: Beginner question using headers Pin
«_Superman_»7-Nov-09 10:57
professional«_Superman_»7-Nov-09 10:57 
AnswerRe: Beginner question using headers Pin
«_Superman_»7-Nov-09 10:56
professional«_Superman_»7-Nov-09 10:56 
GeneralRe: Beginner question using headers Pin
Jacob Dixon7-Nov-09 11:30
Jacob Dixon7-Nov-09 11:30 
GeneralRe: Beginner question using headers Pin
Chris Losinger7-Nov-09 14:37
professionalChris Losinger7-Nov-09 14:37 
GeneralRe: Beginner question using headers Pin
Jacob Dixon7-Nov-09 14:41
Jacob Dixon7-Nov-09 14:41 
GeneralRe: Beginner question using headers Pin
Tim Craig7-Nov-09 21:07
Tim Craig7-Nov-09 21:07 
GeneralRe: Beginner question using headers [modified] Pin
LunaticFringe8-Nov-09 8:49
LunaticFringe8-Nov-09 8:49 
GeneralRe: Beginner question using headers Pin
Chris Losinger8-Nov-09 10:13
professionalChris Losinger8-Nov-09 10:13 
GeneralRe: Beginner question using headers Pin
LunaticFringe8-Nov-09 10:26
LunaticFringe8-Nov-09 10:26 
QuestionGet IExplorerBrowser from a Windows Explorer (Vista) Pin
Ivo Beltchev7-Nov-09 7:35
Ivo Beltchev7-Nov-09 7:35 
QuestionImage in word document Pin
arpanmukherjee17-Nov-09 4:28
arpanmukherjee17-Nov-09 4:28 
AnswerRe: Image in word document Pin
Maximilien7-Nov-09 5:24
Maximilien7-Nov-09 5:24 
GeneralRe: Image in word document Pin
arpanmukherjee17-Nov-09 23:35
arpanmukherjee17-Nov-09 23:35 

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.