Click here to Skip to main content
15,886,963 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Simple input and output program that quits to soon. I cant find the problem, please take a look. Pin
Bram van Kampen17-Jan-10 14:45
Bram van Kampen17-Jan-10 14:45 
GeneralRe: Simple input and output program that quits to soon. I cant find the problem, please take a look. Pin
Luc Pattyn17-Jan-10 14:49
sitebuilderLuc Pattyn17-Jan-10 14:49 
GeneralRe: Simple input and output program that quits to soon. I cant find the problem, please take a look. Pin
Bram van Kampen17-Jan-10 15:04
Bram van Kampen17-Jan-10 15:04 
GeneralRe: Simple input and output program that quits to soon. I cant find the problem, please take a look. Pin
Luc Pattyn17-Jan-10 15:11
sitebuilderLuc Pattyn17-Jan-10 15:11 
AnswerRe: Simple input and output program that quits to soon. I cant find the problem, please take a look. Pin
Avi Berger17-Jan-10 10:30
Avi Berger17-Jan-10 10:30 
GeneralRe: Simple input and output program that quits to soon. I cant find the problem, please take a look. Pin
rbwest8617-Jan-10 11:03
rbwest8617-Jan-10 11:03 
AnswerRe: Simple input and output program that quits to soon. I cant find the problem, please take a look. Pin
rbwest8617-Jan-10 11:57
rbwest8617-Jan-10 11:57 
Questiona fscanf error in MFC SDI Pin
CHYGO17-Jan-10 9:47
CHYGO17-Jan-10 9:47 
my code:
#include "stdafx.h"
#include <stdio.h>
#include <fstream>

void CParamDisplay::OnParamOpen() 
{
	// TODO: Add your control notification handler code here
	CFileDialog cfiledlg(TRUE, NULL, NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT
		, "Text Files (*.txt)|*.txt|All Files (*.*)|*.*||", this);

	if (IDOK == cfiledlg.DoModal())
	{
		m_filename = cfiledlg.GetPathName();
		UpdateData(FALSE);
		DisplayParam(m_filename);
	}	
}

BOOL CParamDisplay::DisplayParam(CString filename)
{
	UINT sNum = 0;
	CHAR paramId[MAX_BUF_SIZE] = _T("");
	CHAR paramUnit[MAX_BUF_SIZE] = _T("");
	FLOAT  paramValue = 0;

	FILE* pFile = fopen (filename, "r");

	if(pFile == NULL)
		return FALSE;

	while(fscanf(pFile, "%d %s %s %f", sNum, paramId, paramUnit, paramValue) != EOF)
	{
         ...
	}

	fclose(pFile);

	return TRUE;
}

when i debug it, the app stopped at fscanf().and displayed:"Uhandled exception in XX.exe (MSVCRTD.DLL):0XC00000005:access violation".i can't fix it...(T_T)

i 've tried ,then i have no regret

AnswerRe: a fscanf error in MFC SDI Pin
Garth J Lancaster17-Jan-10 10:37
professionalGarth J Lancaster17-Jan-10 10:37 
GeneralRe: a fscanf error in MFC SDI Pin
CHYGO17-Jan-10 17:55
CHYGO17-Jan-10 17:55 
AnswerRe: a fscanf error in MFC SDI Pin
Bram van Kampen17-Jan-10 10:40
Bram van Kampen17-Jan-10 10:40 
GeneralRe: a fscanf error in MFC SDI Pin
Garth J Lancaster17-Jan-10 14:30
professionalGarth J Lancaster17-Jan-10 14:30 
GeneralRe: a fscanf error in MFC SDI Pin
Bram van Kampen17-Jan-10 14:53
Bram van Kampen17-Jan-10 14:53 
GeneralRe: a fscanf error in MFC SDI Pin
CHYGO17-Jan-10 17:58
CHYGO17-Jan-10 17:58 
QuestionVisual C++ 2005 in Windows PE 2 [modified] [SOLVED] Pin
dybs17-Jan-10 5:59
dybs17-Jan-10 5:59 
AnswerRe: Visual C++ 2005 in Windows PE 2 Pin
dybs17-Jan-10 13:35
dybs17-Jan-10 13:35 
GeneralRe: Visual C++ 2005 in Windows PE 2 Pin
Spawn@Melmac18-Jan-10 0:19
Spawn@Melmac18-Jan-10 0:19 
GeneralRe: Visual C++ 2005 in Windows PE 2 Pin
dybs18-Jan-10 13:20
dybs18-Jan-10 13:20 
QuestionMessage Removed Pin
17-Jan-10 5:30
softwaremonkey17-Jan-10 5:30 
AnswerRe: Conditional Library Linkage Pin
cmk17-Jan-10 5:56
cmk17-Jan-10 5:56 
GeneralRe: Conditional Library Linkage Pin
softwaremonkey17-Jan-10 5:59
softwaremonkey17-Jan-10 5:59 
GeneralRe: Conditional Library Linkage Pin
Iain Clarke, Warrior Programmer17-Jan-10 22:41
Iain Clarke, Warrior Programmer17-Jan-10 22:41 
GeneralRe: Conditional Library Linkage Pin
softwaremonkey18-Jan-10 10:46
softwaremonkey18-Jan-10 10:46 
Questionhow to associate a bit map to a spin control button? Pin
timbk17-Jan-10 5:13
timbk17-Jan-10 5:13 
AnswerRe: how to associate a bit map to a spin control button? Pin
Graham Shanks17-Jan-10 6:17
Graham Shanks17-Jan-10 6:17 

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.