Click here to Skip to main content
15,910,603 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: accessing variables in Dialog Windows Pin
toon26-Aug-02 23:33
toon26-Aug-02 23:33 
Generalglobal struct - typedef & tag :: C++ Pin
valikac26-Aug-02 20:05
valikac26-Aug-02 20:05 
GeneralRe: global struct - typedef & tag :: C++ Pin
markkuk26-Aug-02 20:54
markkuk26-Aug-02 20:54 
GeneralRe: global struct - typedef & tag :: C++ Pin
valikac27-Aug-02 5:18
valikac27-Aug-02 5:18 
GeneralSaving data in a Dialog App Pin
Stumped on Serialization26-Aug-02 19:29
sussStumped on Serialization26-Aug-02 19:29 
GeneralRe: Saving data in a Dialog App Pin
Chris Losinger26-Aug-02 19:55
professionalChris Losinger26-Aug-02 19:55 
GeneralRe: Saving data in a Dialog App Pin
Thanks chris for answering26-Aug-02 20:02
sussThanks chris for answering26-Aug-02 20:02 
GeneralRe: Saving data in a Dialog App Pin
Chris Losinger26-Aug-02 20:08
professionalChris Losinger26-Aug-02 20:08 
here's something i use for one of my apps:

BOOL CMapFile::Write(const char *csFileName)
{

	CFile theFile;
	try
	{
		if (!theFile.Open(csFileName, CFile::modeWrite | CFile::modeCreate))
		{
			return FALSE;
		}
	}
	catch (CException *e)
	{
		e->ReportError();
		e->Delete();
		return FALSE;
	}

	BOOL bOK = TRUE;

	CArchive archive(&theFile, CArchive::store);

	try
	{
		archive << m_csVersion;
		m_data.Serialize(archive);

		archive.Close();
	}
	catch (CException *e)
	{
		e->ReportError();
		e->Delete();
		bOK= FALSE;
	}
	catch (...)
	{
		bOK= FALSE;
	}

	theFile.Close();

	return bOK;
}


inside the 2nd try/catch, i'm doing your standard archive stuff. everything around it is setup and cleanup. reading is almost identical.

-c


Aiei i ea eio aoa i e eio e aigoa
GeneralRe: Saving data in a Dialog App Pin
Ravi Bhavnani27-Aug-02 5:48
professionalRavi Bhavnani27-Aug-02 5:48 
GeneralSession id of a process Pin
adara26-Aug-02 19:23
adara26-Aug-02 19:23 
Generallogical unit and physical unit Pin
vuong hoai nam26-Aug-02 16:32
vuong hoai nam26-Aug-02 16:32 
GeneralRe: logical unit and physical unit Pin
Steen Krogsgaard26-Aug-02 21:11
Steen Krogsgaard26-Aug-02 21:11 
Generalwm_activateapp Pin
vuong hoai nam26-Aug-02 16:21
vuong hoai nam26-Aug-02 16:21 
GeneralOnKillFusus events Pin
Ancient Dragon26-Aug-02 16:16
Ancient Dragon26-Aug-02 16:16 
GeneralRe: OnKillFusus events Pin
Tomasz Sowinski26-Aug-02 22:53
Tomasz Sowinski26-Aug-02 22:53 
QuestionHow to sort file name exactly like Windows Explorer? Pin
Hiusing26-Aug-02 16:05
Hiusing26-Aug-02 16:05 
GeneralMessage Handling for a dialog in a dll Pin
leonwoo26-Aug-02 15:05
leonwoo26-Aug-02 15:05 
GeneralRe: Message Handling for a dialog in a dll Pin
valikac26-Aug-02 15:10
valikac26-Aug-02 15:10 
GeneralRe: Message Handling for a dialog in a dll Pin
leonwoo26-Aug-02 15:25
leonwoo26-Aug-02 15:25 
GeneralRe: Message Handling for a dialog in a dll Pin
Steen Krogsgaard26-Aug-02 21:24
Steen Krogsgaard26-Aug-02 21:24 
Generalusing Appwizard with the "Windows Explorer" style Pin
Tonrar26-Aug-02 12:30
Tonrar26-Aug-02 12:30 
GeneralRe: using Appwizard with the "Windows Explorer" style Pin
Blade[DMS]27-Aug-02 0:31
Blade[DMS]27-Aug-02 0:31 
GeneralLVN_COLUMNCLICK Pin
RK_200026-Aug-02 12:19
RK_200026-Aug-02 12:19 
GeneralRe: LVN_COLUMNCLICK Pin
Tomasz Sowinski26-Aug-02 22:55
Tomasz Sowinski26-Aug-02 22:55 
GeneralQuestion on VS.NET and VS6.0 Compatibility Pin
theorion1626-Aug-02 11:54
susstheorion1626-Aug-02 11:54 

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.