Click here to Skip to main content
15,914,608 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Read a file on click event Pin
CodingLover15-Oct-07 23:05
CodingLover15-Oct-07 23:05 
GeneralRe: Read a file on click event Pin
Naveen15-Oct-07 23:08
Naveen15-Oct-07 23:08 
GeneralRe: Read a file on click event Pin
CodingLover15-Oct-07 23:13
CodingLover15-Oct-07 23:13 
GeneralRe: Read a file on click event Pin
Naveen15-Oct-07 23:20
Naveen15-Oct-07 23:20 
GeneralRe: Read a file on click event Pin
CodingLover15-Oct-07 23:28
CodingLover15-Oct-07 23:28 
GeneralRe: Read a file on click event Pin
Naveen15-Oct-07 23:33
Naveen15-Oct-07 23:33 
GeneralRe: Read a file on click event Pin
CodingLover16-Oct-07 0:46
CodingLover16-Oct-07 0:46 
GeneralRe: Read a file on click event Pin
Naveen16-Oct-07 3:32
Naveen16-Oct-07 3:32 
ya... Either you can read the full text in one read( this will not be possible is the file is too big. because memeory allocation will fail for big length of data ) or read the text in a loop.

// For reading the complete text in single read
void CSRFToolDlg::OnBnClickedRead()<br />
{<br />
<br />
ULONGLONG nLength = openFile.GetLength();// returns the current size of the file<br />
TCHAR* ptempBuffer = new TCHAR[nLength];<br />
UINT readText = 0;<br />
openFile.SeekToBegin();<br />
readText = openFile.Read(tempBuffer, 256 ) ;<br />
SetDlgItemText(IDC_S_READ, ptempBuffer ) ;<br />
delete[] ptempBuffer;<br />
}



GeneralRe: Read a file on click event Pin
chandu00416-Oct-07 1:36
chandu00416-Oct-07 1:36 
GeneralRe: Read a file on click event Pin
Naveen16-Oct-07 3:35
Naveen16-Oct-07 3:35 
GeneralRe: Read a file on click event Pin
chandu00416-Oct-07 4:12
chandu00416-Oct-07 4:12 
GeneralRe: Read a file on click event Pin
Naveen16-Oct-07 5:12
Naveen16-Oct-07 5:12 
GeneralRe: Read a file on click event Pin
chandu00416-Oct-07 20:49
chandu00416-Oct-07 20:49 
AnswerRe: Read a file on click event Pin
Roger Broomfield15-Oct-07 21:36
Roger Broomfield15-Oct-07 21:36 
GeneralRe: Read a file on click event Pin
CodingLover15-Oct-07 21:54
CodingLover15-Oct-07 21:54 
GeneralRe: Read a file on click event Pin
Roger Broomfield15-Oct-07 22:00
Roger Broomfield15-Oct-07 22:00 
GeneralRe: Read a file on click event Pin
chandu00415-Oct-07 22:01
chandu00415-Oct-07 22:01 
GeneralRe: Read a file on click event Pin
CodingLover15-Oct-07 22:17
CodingLover15-Oct-07 22:17 
GeneralRe: Read a file on click event Pin
chandu00415-Oct-07 22:31
chandu00415-Oct-07 22:31 
GeneralRe: Read a file on click event Pin
CodingLover15-Oct-07 22:41
CodingLover15-Oct-07 22:41 
AnswerRe: Read a file on click event Pin
krmed16-Oct-07 1:46
krmed16-Oct-07 1:46 
QuestionRe: Read a file on click event Pin
David Crow16-Oct-07 2:33
David Crow16-Oct-07 2:33 
AnswerRe: Read a file on click event Pin
Mark Salsbery16-Oct-07 5:53
Mark Salsbery16-Oct-07 5:53 
GeneralRe: Read a file on click event Pin
David Crow16-Oct-07 6:01
David Crow16-Oct-07 6:01 
AnswerRe: Read a file on click event Pin
CodingLover16-Oct-07 18:00
CodingLover16-Oct-07 18:00 

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.