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

C / C++ / MFC

 
GeneralYour op. about .Net Pin
blink4me17-Feb-02 11:16
blink4me17-Feb-02 11:16 
GeneralRe: Your op. about .Net Pin
Christian Graus17-Feb-02 12:22
protectorChristian Graus17-Feb-02 12:22 
QuestionSo what does the .NET Framework do??? Pin
Nnamdi Onyeyiri17-Feb-02 10:36
Nnamdi Onyeyiri17-Feb-02 10:36 
AnswerRe: So what does the .NET Framework do??? Pin
moliate17-Feb-02 11:51
moliate17-Feb-02 11:51 
GeneralRe: So what does the .NET Framework do??? Pin
Simon Walton17-Feb-02 12:11
Simon Walton17-Feb-02 12:11 
GeneralRe: So what does the .NET Framework do??? Pin
Tim Smith17-Feb-02 13:07
Tim Smith17-Feb-02 13:07 
AnswerRe: So what does the .NET Framework do??? Pin
Nish Nishant17-Feb-02 13:44
sitebuilderNish Nishant17-Feb-02 13:44 
Questionwhats wrong here? Pin
Steve L.17-Feb-02 8:54
Steve L.17-Feb-02 8:54 
Ive gotten this much. Its a dialog app, I dont know if that matters.
void CCursorCreatorDlg::OnFileSave() 
{
	CFileDialog fileDlg(FALSE, NULL, "Untitled",
		OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
		"Some Files(*.fil)|*.fil||",
		NULL );
	fileDlg.m_ofn.lpstrDefExt = "cur";
	if( fileDlg.DoModal()==IDOK )
	{
		CString fileName;
		fileName = fileDlg.GetPathName();
	
		CFile file( fileName, CFile::modeReadWrite | CFile::modeCreate );
		CArchive ar( &file, CArchive::store );
		Serialize( ar );
	}
}

void CCursorCreatorDlg::OnFileOpen() 
{
	CFileDialog fileDlg(TRUE, NULL, NULL,
		OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
		"Some Files(*.fil)|*.fil||",
		NULL );
	if( fileDlg.DoModal()==IDOK )
	{
		CString fileName;
		fileName = fileDlg.GetPathName();

		CFile file(fileName, CFile::modeReadWrite | CFile::modeCreate );
		CArchive ar( &file, CArchive::load );
		Serialize( ar );
	}
}

void CCursorCreatorDlg::Serialize(CArchive& ar) 
{

	if (ar.IsStoring())
	{	// storing code
		ar << someVariable;
	}
	else
	{	// loading code
		ar >> someVariable; 
	}
}

I have the DECLARE_SERIAL and IMPLEMENT_SERIAL macros where they should be.
When I save, it seems to work fine. However, when I open, it works until it gets to the serialize function where a messagebox pops up and says "An attempt was made to access an unnamed file past its end." What's that mean and how do I fix it?

-Raffi
The truth about C++
AnswerRe: whats wrong here? Pin
Kashif Manzoor17-Feb-02 9:01
Kashif Manzoor17-Feb-02 9:01 
AnswerRe: whats wrong here? Pin
Dominik Reichl17-Feb-02 9:27
Dominik Reichl17-Feb-02 9:27 
GeneralRe: whats wrong here? Pin
Steve L.17-Feb-02 9:39
Steve L.17-Feb-02 9:39 
QuestionHow can one make a pointer to a constant? Pin
17-Feb-02 8:34
suss17-Feb-02 8:34 
AnswerRe: How can one make a pointer to a constant? Pin
Joaquín M López Muñoz17-Feb-02 8:46
Joaquín M López Muñoz17-Feb-02 8:46 
GeneralRe: How can one make a pointer to a constant? Pin
17-Feb-02 8:52
suss17-Feb-02 8:52 
QuestionHow to menu click ? Pin
pramod kumar17-Feb-02 4:40
pramod kumar17-Feb-02 4:40 
AnswerRe: How to menu click ? Pin
Michael Dunn17-Feb-02 8:28
sitebuilderMichael Dunn17-Feb-02 8:28 
Generalnew SaveAs IE dialog buttons (the ones on the left) Pin
17-Feb-02 3:41
suss17-Feb-02 3:41 
GeneralRe: new SaveAs IE dialog buttons (the ones on the left) Pin
Tim Smith17-Feb-02 3:52
Tim Smith17-Feb-02 3:52 
GeneralRe: new SaveAs IE dialog buttons (the ones on the left) Pin
17-Feb-02 4:18
suss17-Feb-02 4:18 
GeneralRe: new SaveAs IE dialog buttons (the ones on the left) Pin
Simon Walton17-Feb-02 4:29
Simon Walton17-Feb-02 4:29 
GeneralRe: new SaveAs IE dialog buttons (the ones on the left) Pin
Lockhart17-Feb-02 7:10
Lockhart17-Feb-02 7:10 
GeneralRe: new SaveAs IE dialog buttons (the ones on the left) Pin
Simon Walton17-Feb-02 9:30
Simon Walton17-Feb-02 9:30 
GeneralRe: new SaveAs IE dialog buttons (the ones on the left) Pin
Lockhart17-Feb-02 11:21
Lockhart17-Feb-02 11:21 
GeneralRe: new SaveAs IE dialog buttons (the ones on the left) Pin
Michael Dunn17-Feb-02 8:30
sitebuilderMichael Dunn17-Feb-02 8:30 
GeneralRe: new SaveAs IE dialog buttons (the ones on the left) Pin
Lockhart17-Feb-02 11:24
Lockhart17-Feb-02 11:24 

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.