Click here to Skip to main content
16,007,858 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CListCtrl adds blank items Pin
Michael Dunn5-Oct-02 17:47
sitebuilderMichael Dunn5-Oct-02 17:47 
GeneralRe: CListCtrl adds blank items Pin
monrobot136-Oct-02 2:18
monrobot136-Oct-02 2:18 
GeneralRe: CListCtrl adds blank items Pin
Michael Dunn6-Oct-02 6:06
sitebuilderMichael Dunn6-Oct-02 6:06 
GeneralRe: CListCtrl adds blank items Pin
monrobot136-Oct-02 9:51
monrobot136-Oct-02 9:51 
GeneralHelp! Pin
Sunnygirl5-Oct-02 10:19
Sunnygirl5-Oct-02 10:19 
GeneralRe: Help! Pin
User 66585-Oct-02 10:51
User 66585-Oct-02 10:51 
GeneralRe: Help! Pin
Sunnygirl5-Oct-02 11:57
Sunnygirl5-Oct-02 11:57 
GeneralRe: Help! Pin
RobJones5-Oct-02 12:53
RobJones5-Oct-02 12:53 
I do it like this..

CString strBuff;
CFile file;
if(file.Open(_T("anyfile.dat"),CFile::modeRead))
{
	//Declare a large buffer for reading the text
	char cBuf[2048];
	UINT uBytesRead;
					
	//Continue reading until no more data is read
	while(uBytesRead = file.Read(cBuf, sizeof(cBuf)-1))
	{
		//Null terminate after the last charcter
		cBuf[uBytesRead] = NULL;
		
		//add the buffer to the mapped CString
		strBuff += CString(cBuf);
	}
	// Make sure you close the file after reading		
	file.Close();

// Now do something with the string strBuff
...
}
else
{
// the file couldnt be opened get errors here
}


Hope it helps

Rob
GeneralRe: Help! Pin
Sunnygirl5-Oct-02 13:41
Sunnygirl5-Oct-02 13:41 
GeneralRe: Help! Pin
alex.barylski5-Oct-02 17:22
alex.barylski5-Oct-02 17:22 
GeneralRe: Help! Pin
Sunnygirl5-Oct-02 22:40
Sunnygirl5-Oct-02 22:40 
GeneralRe: Help! Pin
alex.barylski5-Oct-02 23:59
alex.barylski5-Oct-02 23:59 
GeneralShell programing Pin
Member 135142965-Oct-02 9:19
Member 135142965-Oct-02 9:19 
GeneralRe: Shell programing Pin
Michael Dunn5-Oct-02 9:45
sitebuilderMichael Dunn5-Oct-02 9:45 
QuestionNo empty CControlBar??? Pin
Daniel Strigl5-Oct-02 8:40
Daniel Strigl5-Oct-02 8:40 
GeneralRecommended Advanced C++ Books :: C++ Pin
valikac5-Oct-02 5:22
valikac5-Oct-02 5:22 
GeneralRe: Recommended Advanced C++ Books :: C++ Pin
Paul M Watt5-Oct-02 6:21
mentorPaul M Watt5-Oct-02 6:21 
GeneralRe: Recommended Advanced C++ Books :: C++ Pin
valikac5-Oct-02 6:32
valikac5-Oct-02 6:32 
GeneralRe: Recommended Advanced C++ Books :: C++ Pin
Mike Nordell5-Oct-02 7:58
Mike Nordell5-Oct-02 7:58 
GeneralRe: Recommended Advanced C++ Books :: C++ Pin
Pavel Klocek5-Oct-02 8:01
Pavel Klocek5-Oct-02 8:01 
GeneralRe: Recommended Advanced C++ Books :: C++ Pin
valikac5-Oct-02 13:25
valikac5-Oct-02 13:25 
QuestionHow to select a item in a listbox? Pin
chen5-Oct-02 4:46
chen5-Oct-02 4:46 
AnswerRe: How to select a item in a listbox? Pin
valikac5-Oct-02 5:33
valikac5-Oct-02 5:33 
GeneralRe: How to select a item in a listbox? Pin
chen5-Oct-02 6:03
chen5-Oct-02 6:03 
GeneralRe: How to select a item in a listbox? Pin
valikac5-Oct-02 6:14
valikac5-Oct-02 6:14 

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.