Click here to Skip to main content
15,906,097 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Cast operator example? Pin
peterchen22-May-03 7:57
peterchen22-May-03 7:57 
GeneralRe: Cast operator example? Pin
Ravi Bhavnani22-May-03 8:17
professionalRavi Bhavnani22-May-03 8:17 
AnswerRe: Cast operator example? Pin
Michael Dunn22-May-03 8:12
sitebuilderMichael Dunn22-May-03 8:12 
GeneralRe: Cast operator example? Pin
Ravi Bhavnani22-May-03 8:18
professionalRavi Bhavnani22-May-03 8:18 
General(Updated) Bitmap and Radio Button :o) Pin
MemLeak22-May-03 7:17
MemLeak22-May-03 7:17 
GeneralCFile::Read Pin
djordj22-May-03 7:08
djordj22-May-03 7:08 
GeneralRe: CFile::Read Pin
Chris Losinger22-May-03 7:15
professionalChris Losinger22-May-03 7:15 
GeneralRe: CFile::Read Pin
RobJones22-May-03 7:20
RobJones22-May-03 7:20 
I would use a loop to keep reading the file.. something like this.
CFile tmpFile;
CString fileName = "C:\\sometext.txt";
CString strStorage;

if(tmpFile.Open(fileName,CFile::modeRead))
{
	// Declare a large buffer for reading the text
	char cBuf[1024];
	UINT uBytesRead;

	// Continue reading until no more data is read
	while(uBytesRead = tmpFile.Read(cBuf, sizeof(cBuf)-1))
	{
		// Null terminate after the last charcter
		cBuf[uBytesRead] = NULL;

		// add the buffer to the mapped CString
		strStorage += CString(cBuf);
	}

	//Close the file
	tmpFile.Close();
}

I didnt compile this so it may have typo's.. Should point you in the right direction..

Rob

Whoever said nothing's impossible never tried slamming a revolving door!
GeneralRe: CFile::Read Pin
John R. Shaw22-May-03 7:23
John R. Shaw22-May-03 7:23 
GeneralFour dialogs Pin
emrosa22-May-03 7:07
emrosa22-May-03 7:07 
GeneralRe: Four dialogs Pin
John R. Shaw22-May-03 7:13
John R. Shaw22-May-03 7:13 
GeneralDll's with win32 project Pin
Mazdak22-May-03 6:48
Mazdak22-May-03 6:48 
GeneralRe: Dll's with win32 project Pin
David Crow22-May-03 6:51
David Crow22-May-03 6:51 
GeneralRe: Dll's with win32 project Pin
Mazdak22-May-03 6:59
Mazdak22-May-03 6:59 
GeneralRe: Dll's with win32 project Pin
David Crow22-May-03 7:16
David Crow22-May-03 7:16 
GeneralRe: Dll's with win32 project Pin
Mazdak22-May-03 7:20
Mazdak22-May-03 7:20 
GeneralRe: Dll's with win32 project Pin
David Crow22-May-03 7:26
David Crow22-May-03 7:26 
GeneralRe: Dll's with win32 project Pin
Mazdak22-May-03 8:06
Mazdak22-May-03 8:06 
GeneralRe: Dll's with win32 project Pin
David Crow22-May-03 8:24
David Crow22-May-03 8:24 
GeneralRe: Dll's with win32 project Pin
John R. Shaw22-May-03 7:06
John R. Shaw22-May-03 7:06 
GeneralRe: Dll's with win32 project Pin
Mazdak22-May-03 7:19
Mazdak22-May-03 7:19 
GeneralRe: Dll's with win32 project Pin
John R. Shaw22-May-03 7:31
John R. Shaw22-May-03 7:31 
GeneralRe: Dll's with win32 project Pin
Mazdak22-May-03 8:10
Mazdak22-May-03 8:10 
GeneralRe: Dll's with win32 project Pin
John R. Shaw22-May-03 8:22
John R. Shaw22-May-03 8:22 
GeneralRe: Dll's with win32 project Pin
Chris Richardson22-May-03 17:35
Chris Richardson22-May-03 17:35 

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.