Click here to Skip to main content
15,887,346 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: LANGID Pin
Richard MacCutchan11-Oct-11 23:18
mveRichard MacCutchan11-Oct-11 23:18 
AnswerRe: LANGID Pin
Randor 11-Oct-11 23:34
professional Randor 11-Oct-11 23:34 
QuestionCListCtrl Pin
john563211-Oct-11 20:43
john563211-Oct-11 20:43 
AnswerRe: CListCtrl Pin
zon_cpp11-Oct-11 21:03
zon_cpp11-Oct-11 21:03 
GeneralRe: CListCtrl Pin
john563211-Oct-11 22:00
john563211-Oct-11 22:00 
GeneralRe: CListCtrl Pin
Randor 11-Oct-11 23:10
professional Randor 11-Oct-11 23:10 
AnswerRe: CListCtrl Pin
Rolf Kristensen12-Oct-11 2:24
Rolf Kristensen12-Oct-11 2:24 
Questionhow to write/read in text file with mfc project?? Pin
antonio34311-Oct-11 7:29
antonio34311-Oct-11 7:29 
I'm trying to read text from a text file. I look for in msdn how to read and write in text file, and I found this:
http://msdn.microsoft.com/es-es/library/6337eske.aspx[^]

I made this funtion to read from my text file:

void CDlgResultados::loadFromFile(void)
{
	CString path= GetUserHomeDir() + _T("\\Documents\\file.txt");
	
	TCHAR	szBuffer[256]; 
	UINT    nActual = 0; 
	CFile	myFile;

	if ( myFile.Open(path, CFile::modeCreate |   
	   CFile::modeRead ) )
	{
	   myFile.Write( szBuffer, sizeof( szBuffer ) ); 
	   myFile.Flush();
	   myFile.Seek( 0, CFile::begin );
	   nActual = myFile.Read( szBuffer, sizeof( szBuffer ) ); 
	}
	m_Edit.SetWindowTextW(szBuffer);
}



But when I run the app and I press the button to read the file, I get a error that it said:
You dont have acces to this file.
AnswerRe: how to write/read in text file with mfc project?? Pin
Richard MacCutchan11-Oct-11 7:49
mveRichard MacCutchan11-Oct-11 7:49 
GeneralRe: how to write/read in text file with mfc project?? Pin
antonio34311-Oct-11 7:53
antonio34311-Oct-11 7:53 
GeneralRe: how to write/read in text file with mfc project?? Pin
Richard MacCutchan11-Oct-11 8:08
mveRichard MacCutchan11-Oct-11 8:08 
GeneralRe: how to write/read in text file with mfc project?? Pin
antonio34311-Oct-11 8:30
antonio34311-Oct-11 8:30 
AnswerRe: how to write/read in text file with mfc project?? Pin
Maximilien11-Oct-11 7:55
Maximilien11-Oct-11 7:55 
AnswerRe: how to write/read in text file with mfc project?? Pin
Chris Meech11-Oct-11 7:59
Chris Meech11-Oct-11 7:59 
AnswerRe: how to write/read in text file with mfc project?? Pin
Madhu Nair11-Oct-11 8:02
Madhu Nair11-Oct-11 8:02 
GeneralRe: how to write/read in text file with mfc project?? Pin
antonio34311-Oct-11 8:19
antonio34311-Oct-11 8:19 
GeneralRe: how to write/read in text file with mfc project?? Pin
Richard MacCutchan11-Oct-11 8:36
mveRichard MacCutchan11-Oct-11 8:36 
GeneralRe: how to write/read in text file with mfc project?? Pin
antonio34311-Oct-11 8:51
antonio34311-Oct-11 8:51 
GeneralRe: how to write/read in text file with mfc project?? Pin
Richard MacCutchan11-Oct-11 10:58
mveRichard MacCutchan11-Oct-11 10:58 
QuestionRe: how to write/read in text file with mfc project?? Pin
David Crow11-Oct-11 10:28
David Crow11-Oct-11 10:28 
AnswerRe: how to write/read in text file with mfc project?? Pin
antonio34311-Oct-11 14:12
antonio34311-Oct-11 14:12 
GeneralRe: how to write/read in text file with mfc project?? Pin
enhzflep11-Oct-11 14:32
enhzflep11-Oct-11 14:32 
GeneralRe: how to write/read in text file with mfc project?? Pin
antonio34311-Oct-11 15:03
antonio34311-Oct-11 15:03 
GeneralRe: how to write/read in text file with mfc project?? Pin
enhzflep11-Oct-11 15:39
enhzflep11-Oct-11 15:39 
QuestionHow to get list of COM Ports in Win32 Pin
pandit8411-Oct-11 0:57
pandit8411-Oct-11 0:57 

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.