zack
2008-06-22 10:38:01 UTC
Hi I am trying to write to hex file ,
this is my first time writing to file in windows vista,
So first i will let the user to create it by the "CFileDialog" and then
save it,
and Then i want to write to the file some data, here is the code i used:
//to save the file
CFileDialog dialog(FALSE,_T("hex"), FilePath, 0, _T("Hex File (*.hex)"),
this);
if (dialog.DoModal() == IDOK)
{
...
}
//open the file for write ,lets say the user choose zack.hex.
nFile = fopen ("C:\Users\user\Documents\IM\coding_PROJECTS\zack.hex","w");
//write to the file 5 char
numberOfBytesWrite = fwrite( sectorBuffer2,sizeof(char),5,nFile);
//close the file
fclose(nFile);
i probebly miss some information,need help
thanks
this is my first time writing to file in windows vista,
So first i will let the user to create it by the "CFileDialog" and then
save it,
and Then i want to write to the file some data, here is the code i used:
//to save the file
CFileDialog dialog(FALSE,_T("hex"), FilePath, 0, _T("Hex File (*.hex)"),
this);
if (dialog.DoModal() == IDOK)
{
...
}
//open the file for write ,lets say the user choose zack.hex.
nFile = fopen ("C:\Users\user\Documents\IM\coding_PROJECTS\zack.hex","w");
//write to the file 5 char
numberOfBytesWrite = fwrite( sectorBuffer2,sizeof(char),5,nFile);
//close the file
fclose(nFile);
i probebly miss some information,need help
thanks