Click here to Skip to main content
15,909,939 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Rebar problems! Pin
Neville Franks13-Feb-05 9:57
Neville Franks13-Feb-05 9:57 
GeneralRe: Rebar problems! Pin
Temuri13-Feb-05 20:19
Temuri13-Feb-05 20:19 
GeneralRe: Rebar problems! Pin
Neville Franks13-Feb-05 20:29
Neville Franks13-Feb-05 20:29 
GeneralRe: Rebar problems! Pin
Temuri13-Feb-05 21:40
Temuri13-Feb-05 21:40 
GeneralRe: Rebar problems! Pin
Neville Franks14-Feb-05 9:29
Neville Franks14-Feb-05 9:29 
GeneralSQLConnect With Custom ODBC Driver Pin
KalliMan13-Feb-05 6:06
KalliMan13-Feb-05 6:06 
QuestionHow to read/write an object of MyClass from/to a file. Pin
six_billion13-Feb-05 5:59
six_billion13-Feb-05 5:59 
AnswerRe: How to read/write an object of MyClass from/to a file. Pin
KalliMan13-Feb-05 6:12
KalliMan13-Feb-05 6:12 
Hi,
You cann't write directly class into File. You must use Serialization, and serialize each memeber from your class. See the sample below and look into MSDN for more Info.

class CPerson : public CObject
{
public:
DECLARE_SERIAL( CPerson )
// empty constructor is necessary
CPerson(){};

CString m_name;
WORD m_number;

void Serialize( CArchive& archive );

// rest of class declaration
};

void CPerson::Serialize( CArchive& archive )
{
// call base class function first
// base class is CObject in this case
CObject::Serialize( archive );

// now do the stuff for our specific class
if( archive.IsStoring() )
archive << m_name << m_number;
else
archive >> m_name >> m_number;
}


a
GeneralRe: How to read/write an object of MyClass from/to a file. Pin
six_billion14-Feb-05 5:21
six_billion14-Feb-05 5:21 
AnswerRe: How to read/write an object of MyClass from/to a file. Pin
Ravi Bhavnani13-Feb-05 8:30
professionalRavi Bhavnani13-Feb-05 8:30 
AnswerRe: How to read/write an object of MyClass from/to a file. Pin
six_billion13-Feb-05 16:42
six_billion13-Feb-05 16:42 
GeneralBM_SETIMAGE strange displaying behavior Pin
toxcct13-Feb-05 4:48
toxcct13-Feb-05 4:48 
GeneralRe: BM_SETIMAGE strange displaying behavior Pin
PJ Arends13-Feb-05 10:23
professionalPJ Arends13-Feb-05 10:23 
GeneralRe: BM_SETIMAGE strange displaying behavior Pin
toxcct13-Feb-05 23:48
toxcct13-Feb-05 23:48 
GeneralDLL Question Pin
Steve Messer13-Feb-05 4:42
Steve Messer13-Feb-05 4:42 
GeneralRe: DLL Question Pin
Mohammad A Gdeisat13-Feb-05 5:37
Mohammad A Gdeisat13-Feb-05 5:37 
GeneralRe: DLL Question Pin
Steve Messer13-Feb-05 7:44
Steve Messer13-Feb-05 7:44 
GeneralRe: DLL Question Pin
14-Feb-05 5:50
suss14-Feb-05 5:50 
GeneralRe: DLL Question Pin
Steve Messer14-Feb-05 5:55
Steve Messer14-Feb-05 5:55 
Generaladd scroll bars to an activex Pin
sstoyan13-Feb-05 4:32
sstoyan13-Feb-05 4:32 
GeneralProgramming a web cam Pin
neilshelton13-Feb-05 2:59
neilshelton13-Feb-05 2:59 
GeneralRe: Programming a web cam Pin
Ted Ferenc13-Feb-05 3:55
Ted Ferenc13-Feb-05 3:55 
GeneralAccess a table of an access database Pin
wushli13-Feb-05 2:01
wushli13-Feb-05 2:01 
QuestionHow to split dialog with separator Pin
Member 151147113-Feb-05 0:24
Member 151147113-Feb-05 0:24 
GeneralActive Accessibility Memory Issue Pin
spsharma12-Feb-05 22:50
spsharma12-Feb-05 22:50 

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.