Click here to Skip to main content
15,899,754 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
GeneralRe: COM Pin
Heiko20037-May-03 11:34
sussHeiko20037-May-03 11:34 
GeneralCreating multiple buttons with one resource Pin
jimNLX7-May-03 7:45
jimNLX7-May-03 7:45 
Generaldll memory and shared segment question Pin
keyser_soze7-May-03 7:41
keyser_soze7-May-03 7:41 
GeneralIs it possible to have one button do the function of two buttons in MFC. Pin
Anonymous7-May-03 7:29
Anonymous7-May-03 7:29 
GeneralRe: Is it possible to have one button do the function of two buttons in MFC. Pin
User 66587-May-03 7:50
User 66587-May-03 7:50 
GeneralRe: Is it possible to have one button do the function of two buttons in MFC. Pin
Maximilien7-May-03 7:50
Maximilien7-May-03 7:50 
GeneralRe: Is it possible to have one button do the function of two buttons in MFC. Pin
jimNLX7-May-03 7:51
jimNLX7-May-03 7:51 
GeneralRe: Is it possible to have one button do the function of two buttons in MFC. Pin
Nick Parker7-May-03 7:56
protectorNick Parker7-May-03 7:56 
Generalfstream question Pin
Shah Shehpori7-May-03 7:15
sussShah Shehpori7-May-03 7:15 
GeneralRe: fstream question Pin
Nathan Blomquist7-May-03 7:23
Nathan Blomquist7-May-03 7:23 
GeneralRe: fstream question Pin
Nick Parker7-May-03 7:44
protectorNick Parker7-May-03 7:44 
GeneralCHeaderCtrl, 2 Problems Pin
schoni7-May-03 7:09
schoni7-May-03 7:09 
GeneralRe: CHeaderCtrl, 2 Problems Pin
David Crow7-May-03 8:01
David Crow7-May-03 8:01 
GeneralCHeaderCtrl Pin
schoni7-May-03 7:08
schoni7-May-03 7:08 
GeneralRe: CHeaderCtrl Pin
Roger Allen8-May-03 1:26
Roger Allen8-May-03 1:26 

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.