Click here to Skip to main content
15,912,977 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How can I include a pure "C" module in a MFC project Pin
Cesario Simoes, jr8-May-03 4:55
Cesario Simoes, jr8-May-03 4:55 
GeneralExcel automation Pin
aluna7-May-03 12:21
aluna7-May-03 12:21 
GeneralRe: Excel automation Pin
Stephane Rodriguez.8-May-03 1:10
Stephane Rodriguez.8-May-03 1:10 
GeneralAdding Splash Screen in DLL Pin
iltallman7-May-03 10:55
iltallman7-May-03 10:55 
GeneralRe: Adding Splash Screen in DLL Pin
valikac7-May-03 11:28
valikac7-May-03 11:28 
GeneralRe: Adding Splash Screen in DLL Pin
Joe Woodbury7-May-03 11:58
professionalJoe Woodbury7-May-03 11:58 
GeneralWizards Pin
dave_long7-May-03 9:58
dave_long7-May-03 9:58 
GeneralRe: Wizards Pin
David Crow7-May-03 10:05
David Crow7-May-03 10:05 
Questionhow to display icon in system tray Pin
djghazi7-May-03 9:49
djghazi7-May-03 9:49 
AnswerRe: how to display icon in system tray Pin
David Crow7-May-03 10:03
David Crow7-May-03 10:03 
GeneralChanging file properties Pin
john john mackey7-May-03 9:13
john john mackey7-May-03 9:13 
GeneralRe: Changing file properties Pin
David Crow7-May-03 9:30
David Crow7-May-03 9:30 
GeneralRe: Changing file properties Pin
john john mackey7-May-03 9:59
john john mackey7-May-03 9:59 
GeneralListview Font Pin
Anthony98877-May-03 8:57
Anthony98877-May-03 8:57 
GeneralRe: Listview Font Pin
basementman7-May-03 10:48
basementman7-May-03 10:48 
Questionuse ShellExecute ? Pin
_skidrow_vn_7-May-03 8:56
_skidrow_vn_7-May-03 8:56 
AnswerRe: use ShellExecute ? Pin
David Crow7-May-03 9:28
David Crow7-May-03 9:28 
GeneralRe: use ShellExecute ? Pin
_skidrow_vn_7-May-03 9:39
_skidrow_vn_7-May-03 9:39 
GeneralRe: use ShellExecute ? Pin
_skidrow_vn_7-May-03 9:46
_skidrow_vn_7-May-03 9:46 
GeneralCArchiveException Pin
Shay Harel7-May-03 8:46
Shay Harel7-May-03 8:46 
GeneralRe: CArchiveException Pin
David Crow7-May-03 8:54
David Crow7-May-03 8:54 
GeneralRe: CArchiveException Pin
Anonymous7-May-03 8:59
Anonymous7-May-03 8:59 
GeneralRe: CArchiveException Pin
basementman7-May-03 10:55
basementman7-May-03 10:55 
What I have found is the easiest method of handling schema changes (since the MFC Schema stuff does nothing) is to write out a couple of extra bytes in each object. This will let you do your own object versioning and conditional serialization. Example:

void MyClass::Serialize(CArchive &archive)
{
WORD wMagicNum;
WORD wVersion;

CObject::Serialize(archive);

if (archive.IsStoring())
{
archive << (WORD)0x4C53; // LS
archive << (WORD)4; // version

archive << m_cServerConfigName << m_cLoginHTMLFileName << m_cDefaultIPAddress;
archive << (WORD)m_bUseSSL << (WORD)m_wNumWorkerThreads;
archive << (DWORD)m_iInputBufferSize << (DWORD)m_iOutputBufferSize;
archive << (DWORD)m_iSQLBufferSize << (DWORD)m_iMaxParameters;

archive << m_cCurrentApplicationSetFileName;

archive << (WORD)m_bUseMailSender << m_cMailProfile << m_cMailProfilePassword << (DWORD)m_iMailWorkerThreadCount;
archive << m_cSMTPHost << (DWORD)m_iSMTPAuthenticationMode << m_cSMTPUserName;
archive << m_cSMTPPassword << (DWORD)m_iSMTPPort << m_cSMTPBoundIP << (DWORD)m_iMailTransportToUse;

archive << (WORD)m_bOutputPerformanceHeader << (WORD)m_bCompactOutputBuffer;

}
else
{
archive >> (WORD&)wMagicNum;
if (wMagicNum != 0x4C53)
{
TRACE("Bad id number in front of a LightningServer item\n");
AfxThrowArchiveException(CArchiveException::generic);
}

archive >> (WORD&)wVersion;

archive >> m_cServerConfigName >> m_cLoginHTMLFileName >> m_cDefaultIPAddress;
archive >> (WORD&)m_bUseSSL >> (WORD&)m_wNumWorkerThreads;
archive >> (DWORD&)m_iInputBufferSize >> (DWORD&)m_iOutputBufferSize;
archive >> (DWORD&)m_iSQLBufferSize >> (DWORD&)m_iMaxParameters;

archive >> m_cCurrentApplicationSetFileName;

if (wVersion > 0)
{
archive >> (WORD&)m_bUseMailSender >> m_cMailProfile >> m_cMailProfilePassword >> (DWORD&)m_iMailWorkerThreadCount;
if (wVersion > 1)
{
archive >> m_cSMTPHost >> (DWORD&)m_iSMTPAuthenticationMode >> m_cSMTPUserName;
archive >> m_cSMTPPassword >> (DWORD&)m_iSMTPPort >> m_cSMTPBoundIP >> (DWORD&)m_iMailTransportToUse;
}

if (wVersion > 2)
archive >> (WORD&)m_bOutputPerformanceHeader;

if (wVersion > 3)
archive >> (WORD&)m_bCompactOutputBuffer;
}
}
}

GeneralAdding Controls Dynamically to CFormView Pin
Muhammad Yousaf7-May-03 8:43
Muhammad Yousaf7-May-03 8:43 
GeneralCOM Pin
Heiko20037-May-03 8:08
sussHeiko20037-May-03 8:08 

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.