Click here to Skip to main content
15,910,471 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: To fire a button click event programmatically Pin
Jose Lamas Rios5-Oct-05 9:48
Jose Lamas Rios5-Oct-05 9:48 
GeneralRe: To fire a button click event programmatically Pin
Liu Shuai5-Oct-05 10:09
Liu Shuai5-Oct-05 10:09 
GeneralRe: To fire a button click event programmatically Pin
shweta yadaki9-Dec-13 19:11
shweta yadaki9-Dec-13 19:11 
QuestionWindow does not maximize when trying to run one instance of program Pin
elephantstar5-Oct-05 6:45
elephantstar5-Oct-05 6:45 
AnswerRe: Window does not maximize when trying to run one instance of program Pin
Jeffrey Walton5-Oct-05 9:31
Jeffrey Walton5-Oct-05 9:31 
AnswerRe: Window does not maximize when trying to run one instance of program Pin
Bartosz Bien5-Oct-05 12:02
Bartosz Bien5-Oct-05 12:02 
GeneralRe: Window does not maximize when trying to run one instance of program Pin
elephantstar5-Oct-05 14:00
elephantstar5-Oct-05 14:00 
QuestionI don't get to read the file lines Pin
Alex Cutovoi5-Oct-05 6:24
Alex Cutovoi5-Oct-05 6:24 
Hi fellows

I'm a doubt: I have this program to read each line of a file and write into it again with some new values, but the program doesn't read the lines and in the message box, it show the value "0". Who can helps me to solve this?
I want to read all lines of my file and write values in a determined position.
Below the code, thanks a lot for help:

void EscreveArquivo(char* cValues)
{
notas* tNotas = new notas;
char* cValue = new char[256];
FILE* pFile;
bool bEnd = false;
char* c = new char[256];
pFile = fopen("c:\\arquivo.txt", "a");
if(pFile != NULL)
{
while(!feof(pFile))
{
fread(cValue,4,1,pFile);
tNotas->iNota = atoi(cValue);
MessageBox(0, itoa(tNotas->iNota,cValue,10),"tela",0);
notas* aux = new notas;
aux->next = tNotas;
tNotas = aux;
break;
}
while(!bEnd)
{
//fread(tNotas, sizeof(tNotas), 1, pFile);
//tNotas->iNota += atoi(cValues);
switch(tNotas->iNota)
{
case 1:
i1Real += 1;
break;
}
itoa(i1Real,cValue, 10);
fseek(pFile, 2, 0);
fwrite(cValue, 1, 1, pFile);
if(tNotas->next == NULL)
{
bEnd = true;
}
tNotas = tNotas->next;
}
}
fclose(pFile);
delete tNotas;
delete[] cValue;
}

int main()
{
char* cBuffer = new char[256];
EscreveArquivo(itoa(10,cBuffer,10));

QuestionRe: I don't get to read the file lines Pin
David Crow5-Oct-05 6:36
David Crow5-Oct-05 6:36 
Question[Message Deleted] Pin
ddmcr5-Oct-05 5:03
ddmcr5-Oct-05 5:03 
AnswerRe: char [] problem Pin
Chris Losinger5-Oct-05 5:10
professionalChris Losinger5-Oct-05 5:10 
AnswerRe: char [] problem Pin
toxcct5-Oct-05 5:20
toxcct5-Oct-05 5:20 
QuestionQuestion about CString Pin
LaHaHa5-Oct-05 4:29
LaHaHa5-Oct-05 4:29 
AnswerRe: Question about CString Pin
Chris Losinger5-Oct-05 4:36
professionalChris Losinger5-Oct-05 4:36 
JokeRe: Question about CString Pin
toxcct5-Oct-05 4:51
toxcct5-Oct-05 4:51 
AnswerRe: Question about CString Pin
Bob Stanneveld5-Oct-05 6:15
Bob Stanneveld5-Oct-05 6:15 
GeneralRe: Question about CString Pin
LaHaHa5-Oct-05 12:21
LaHaHa5-Oct-05 12:21 
GeneralRe: Question about CString Pin
Roger Stoltz5-Oct-05 21:04
Roger Stoltz5-Oct-05 21:04 
GeneralRe: Question about CString Pin
LaHaHa5-Oct-05 22:54
LaHaHa5-Oct-05 22:54 
GeneralRe: Question about CString Pin
Roger Stoltz5-Oct-05 23:32
Roger Stoltz5-Oct-05 23:32 
GeneralRe: Question about CString Pin
LaHaHa6-Oct-05 1:01
LaHaHa6-Oct-05 1:01 
GeneralRe: Question about CString Pin
Roger Stoltz6-Oct-05 1:26
Roger Stoltz6-Oct-05 1:26 
GeneralRe: Question about CString Pin
LaHaHa6-Oct-05 16:17
LaHaHa6-Oct-05 16:17 
QuestionException 0xE06D7363 Problem? Pin
bosfan5-Oct-05 4:26
bosfan5-Oct-05 4:26 
AnswerRe: Exception 0xE06D7363 Problem? Pin
Bob Stanneveld5-Oct-05 6:17
Bob Stanneveld5-Oct-05 6:17 

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.