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

C / C++ / MFC

 
QuestionProblems with multiple inheritance? Pin
Obliterator17-Nov-03 7:33
Obliterator17-Nov-03 7:33 
AnswerRe: Problems with multiple inheritance? Pin
antlers17-Nov-03 8:27
antlers17-Nov-03 8:27 
Questionhow to keep a running total in a text file? Pin
mike.beck17-Nov-03 6:55
mike.beck17-Nov-03 6:55 
AnswerRe: how to keep a running total in a text file? Pin
Toni7817-Nov-03 7:07
Toni7817-Nov-03 7:07 
GeneralRe: how to keep a running total in a text file? Pin
mike.beck17-Nov-03 8:06
mike.beck17-Nov-03 8:06 
GeneralRe: how to keep a running total in a text file? Pin
Toni7817-Nov-03 17:00
Toni7817-Nov-03 17:00 
AnswerRe: how to keep a running total in a text file? Pin
David Crow17-Nov-03 7:48
David Crow17-Nov-03 7:48 
AnswerRe: how to keep a running total in a text file? Pin
Peter Molnar18-Nov-03 15:26
Peter Molnar18-Nov-03 15:26 
GeneralDetecting dependent DLLs Pin
Arash Sabet17-Nov-03 6:24
Arash Sabet17-Nov-03 6:24 
GeneralRe: Detecting dependent DLLs Pin
igor196017-Nov-03 10:10
igor196017-Nov-03 10:10 
GeneralProblems building a general program using C++ .NET Pin
changuyen17-Nov-03 5:59
changuyen17-Nov-03 5:59 
GeneralRe: Problems building a general program using C++ .NET Pin
Toni7817-Nov-03 7:08
Toni7817-Nov-03 7:08 
GeneralRe: Problems building a general program using C++ .NET Pin
changuyen17-Nov-03 15:02
changuyen17-Nov-03 15:02 
GeneralRe: Problems building a general program using C++ .NET Pin
Michael Gunlock17-Nov-03 18:58
Michael Gunlock17-Nov-03 18:58 
GeneralRe: Problems building a general program using C++ .NET Pin
Anonymous18-Nov-03 23:32
Anonymous18-Nov-03 23:32 
QuestionCompiler for AMD 64? Pin
Robert Buldoc17-Nov-03 5:56
Robert Buldoc17-Nov-03 5:56 
AnswerRe: Compiler for AMD 64? Pin
Maxwell Chen17-Nov-03 17:44
Maxwell Chen17-Nov-03 17:44 
Questionopen files over the net???? Pin
IGeorgeI17-Nov-03 5:22
IGeorgeI17-Nov-03 5:22 
AnswerRe: open files over the net???? Pin
Peter Molnar17-Nov-03 15:02
Peter Molnar17-Nov-03 15:02 
GeneralRight Click on the header in Owner-drawn-fixed CListCtrl Pin
g_sol_117-Nov-03 5:20
g_sol_117-Nov-03 5:20 
GeneralRe: Right Click on the header in Owner-drawn-fixed CListCtrl Pin
Roger Allen17-Nov-03 5:43
Roger Allen17-Nov-03 5:43 
GeneralRe: Right Click on the header in Owner-drawn-fixed CListCtrl Pin
g_sol_117-Nov-03 19:48
g_sol_117-Nov-03 19:48 
GeneralUsing SerializeElements Pin
David Crow17-Nov-03 4:51
David Crow17-Nov-03 4:51 
This function is not being nice to me! Here's what I have:

KeyInfo.h:
class CKeyInfo : public CObject
{
public:
 
    CKeyInfo() {}
    virtual ~CKeyInfo() {}
 
    DECLARE_SERIAL(CKeyInfo)
    virtual void Serialize( CArchive &ar );
};
 
KeyInfo.cpp:
IMPLEMENT_SERIAL(CKeyInfo, CObject, 1)
 
void CKeyInfo::Serialize( CArchive &ar ) // this is never called
{
    CObject::Serialize(ar);
 
    if (ar.IsStoring())
    {
    }
    else
    {
    }
}
 
MyDoc.h:
class CMyDoc : public CDocument
{
    ...
private:
    CArray<CKeyInfo *, CKeyInfo *> m_arrKeyNames;
};
 
MyDoc.cpp:
void CMyDoc::Serialize(CArchive& ar)
{
    if (ar.IsStoring())
    {
    }
    else
    {
    }
 
    m_arrKeyNames.Serialize(ar); // this gets called when the app is closing
}


I've tried placing this function in several places, all to no avail. I've also tried it with several different signatures (e.g., Internet examples, MSDN). It never gets called. The default implementation (in afxtempl.h) does, though.

template <>
void AFXAPI SerializeElements <CKeyInfo> ( CArchive &ar, CKeyInfo *pKeyInfo, int nCount )
{
    // serialize each object
    for (int x = 0; x < nCount; x++, pKeyInfo++)
        pKeyInfo->Serialize(ar);
}


Anyone see what I might be doing wrong?

Thanks,
DC


Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?

GeneralLocalSystem Pin
hph17-Nov-03 4:44
hph17-Nov-03 4:44 
GeneralRetrieve computer names network Pin
Abebe17-Nov-03 4:14
Abebe17-Nov-03 4:14 

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.