Click here to Skip to main content
15,914,215 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: OCX uUid collision nightmare Pin
Derek Waters2-Apr-02 12:29
Derek Waters2-Apr-02 12:29 
QuestionSaving a Document with values from dynamic array? Pin
dazinith2-Apr-02 6:28
dazinith2-Apr-02 6:28 
AnswerRe: Saving a Document with values from dynamic array? Pin
Ravi Bhavnani2-Apr-02 6:43
professionalRavi Bhavnani2-Apr-02 6:43 
GeneralRe: Saving a Document with values from dynamic array? Pin
dazinith2-Apr-02 8:07
dazinith2-Apr-02 8:07 
GeneralRe: Saving a Document with values from dynamic array? Pin
Ravi Bhavnani2-Apr-02 8:22
professionalRavi Bhavnani2-Apr-02 8:22 
GeneralRe: Saving a Document with values from dynamic array? Pin
dazinith2-Apr-02 8:41
dazinith2-Apr-02 8:41 
GeneralRe: Saving a Document with values from dynamic array? Pin
Ravi Bhavnani2-Apr-02 9:08
professionalRavi Bhavnani2-Apr-02 9:08 
GeneralRe: Saving a Document with values from dynamic array? Pin
dazinith2-Apr-02 11:33
dazinith2-Apr-02 11:33 
thank you so much for your help today.. i got the code to do what i want.. and thats be able to store and load a document based off of CObArray.. I just did a simple object, but now i feel i could use it for a much larger object.. here is the finished code if you want to use it to update that article.. again thanks for the help!

p.s. if you do use this as an example you might want to change the var's as m_oaStringList seems like a CStringArray, but is a CObArray.. thanks so much!

void CDocumentTestDoc::Serialize(CArchive& ar)
{
int i;

if (ar.IsStoring())
{
// store the size of the array
int n = m_oaStringList.GetSize();
ar << n;

// loop through and store all data members
for (i = 0; i < m_oaStringList.GetSize(); i++)
{
CTestObj* pObj = (CTestObj*)m_oaStringList.GetAt(i);
pObj->Serialize(ar);
}

}
else // is loading
{
// load the size of the array
int n;
ar >> n;
m_oaStringList.SetSize(n);

// loop through and load all data members
for (i = 0; i < n; i++)
{
CTestObj* pObj = new CTestObj();
pObj->Serialize(ar);
m_oaStringList.SetAt(i,pObj);
}
}
}

-dz
GeneralRe: Saving a Document with values from dynamic array? Pin
Ravi Bhavnani2-Apr-02 11:50
professionalRavi Bhavnani2-Apr-02 11:50 
GeneralRe: Saving a Document with values from dynamic array? Pin
dazinith3-Apr-02 3:10
dazinith3-Apr-02 3:10 
GeneralRe: Saving a Document with values from dynamic array? Pin
Ravi Bhavnani3-Apr-02 3:15
professionalRavi Bhavnani3-Apr-02 3:15 
Questionhow to create a imput mask? Pin
jafrazee2-Apr-02 5:39
jafrazee2-Apr-02 5:39 
AnswerRe: how to create a imput mask? Pin
Chris Losinger2-Apr-02 5:37
professionalChris Losinger2-Apr-02 5:37 
AnswerRe: how to create a imput mask? Pin
dazinith2-Apr-02 6:38
dazinith2-Apr-02 6:38 
GeneralRe: how to create a imput mask? Pin
Jon Hulatt2-Apr-02 23:37
Jon Hulatt2-Apr-02 23:37 
GeneralRe: how to create a imput mask? Pin
dazinith3-Apr-02 3:07
dazinith3-Apr-02 3:07 
Generalicons Pin
tom harwood2-Apr-02 5:30
tom harwood2-Apr-02 5:30 
GeneralRe: icons Pin
lucy2-Apr-02 6:34
lucy2-Apr-02 6:34 
GeneralRe: icons Pin
Shog92-Apr-02 11:59
sitebuilderShog92-Apr-02 11:59 
GeneralRe: icons Pin
moliate2-Apr-02 12:35
moliate2-Apr-02 12:35 
Questionsomething wrong with code??? Pin
Rajveer2-Apr-02 5:07
Rajveer2-Apr-02 5:07 
AnswerRe: something wrong with code??? Pin
Hans Ruck2-Apr-02 5:19
Hans Ruck2-Apr-02 5:19 
GeneralRe: something wrong with code??? Pin
Rajveer2-Apr-02 5:48
Rajveer2-Apr-02 5:48 
AnswerRe: something wrong with code??? Pin
dlhson2-Apr-02 5:22
dlhson2-Apr-02 5:22 
AnswerRe: something wrong with code??? Pin
Christian Graus2-Apr-02 9:32
protectorChristian Graus2-Apr-02 9:32 

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.