Click here to Skip to main content
15,891,777 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
GeneralRe: Retrieve computer names network Pin
David Crow17-Nov-03 4:54
David Crow17-Nov-03 4:54 
GeneralRe: Retrieve computer names network Pin
Abebe17-Nov-03 21:16
Abebe17-Nov-03 21:16 
GeneralPDF 417 barcode reader/printer Pin
Kene17-Nov-03 4:11
Kene17-Nov-03 4:11 
GeneralRe: PDF 417 barcode reader/printer Pin
Roger Allen17-Nov-03 5:47
Roger Allen17-Nov-03 5:47 
GeneralRe: PDF 417 barcode reader/printer Pin
Kene17-Nov-03 21:51
Kene17-Nov-03 21:51 
GeneralNeed help with DataGrid Component Pin
bilas17-Nov-03 4:05
bilas17-Nov-03 4:05 
GeneralRe: Need help with DataGrid Component Pin
Peter Molnar17-Nov-03 14:22
Peter Molnar17-Nov-03 14:22 
GeneralCasting IXMLDocument to VARIANT Pin
bariraniahmad17-Nov-03 3:43
bariraniahmad17-Nov-03 3:43 
GeneralRe: Casting IXMLDocument to VARIANT Pin
Michael Dunn17-Nov-03 4:35
sitebuilderMichael Dunn17-Nov-03 4:35 
GeneralRe: Casting IXMLDocument to VARIANT Pin
bariraniahmad19-Nov-03 3:50
bariraniahmad19-Nov-03 3:50 
GeneralRe: Casting IXMLDocument to VARIANT Pin
Michael Dunn19-Nov-03 11:40
sitebuilderMichael Dunn19-Nov-03 11:40 
QuestionCompiling an idl? Pin
Killen17-Nov-03 2:55
Killen17-Nov-03 2:55 
AnswerRe: Compiling an idl? Pin
Adam Gritt17-Nov-03 5:28
Adam Gritt17-Nov-03 5:28 
GeneralRe: Compiling an idl? Pin
Killen20-Nov-03 10:56
Killen20-Nov-03 10:56 
GeneralSocket creation at Windows 98 Pin
nurpinar17-Nov-03 2:20
nurpinar17-Nov-03 2:20 

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.