Click here to Skip to main content
15,899,754 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
As someone mentioned before, you are attempting to read from the same openFile, however your Write to that file left the file pointer at the end of the file, so your read is trying to read past the end.

What you need to add is
void CSRFToolDlg::OnBnClickedRead()
{
char tempBuffer[256] ;
UINT readText = 0;
openFile.SeekToBegin();
readText = openFile.Read(tempBuffer, strlen(tempBuffer)) ;

SetDlgItemText(IDC_S_READ, readText) ;
}

Hope that helps.



Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193

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 
GeneralRe: Read a file on click event Pin
David Crow17-Oct-07 4:00
David Crow17-Oct-07 4:00 
GeneralRe: Read a file on click event Pin
CodingLover18-Oct-07 20:08
CodingLover18-Oct-07 20:08 
GeneralRe: Read a file on click event Pin
CodingLover16-Oct-07 18:09
CodingLover16-Oct-07 18:09 
GeneralRe: Read a file on click event Pin
David Crow17-Oct-07 4:02
David Crow17-Oct-07 4:02 
GeneralRe: Read a file on click event Pin
CodingLover18-Oct-07 20:16
CodingLover18-Oct-07 20:16 
AnswerRe: Read a file on click event Pin
Mark Salsbery16-Oct-07 6:20
Mark Salsbery16-Oct-07 6:20 
GeneralRe: Read a file on click event Pin
CodingLover16-Oct-07 19:11
CodingLover16-Oct-07 19:11 
GeneralRe: Read a file on click event Pin
chandu00416-Oct-07 20:58
chandu00416-Oct-07 20:58 
GeneralRe: Read a file on click event Pin
CodingLover16-Oct-07 21:08
CodingLover16-Oct-07 21:08 
GeneralRe: Read a file on click event Pin
Mark Salsbery17-Oct-07 5:21
Mark Salsbery17-Oct-07 5:21 
QuestionHow to access all the Editboxes in a form. Pin
Anand Todkar15-Oct-07 19:12
Anand Todkar15-Oct-07 19:12 
AnswerRe: How to access all the Editboxes in a form. Pin
Hamid_RT15-Oct-07 19:19
Hamid_RT15-Oct-07 19:19 
GeneralRe: How to access all the Editboxes in a form. Pin
Anand Todkar15-Oct-07 19:24
Anand Todkar15-Oct-07 19:24 

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.