Click here to Skip to main content
15,884,047 members

Comments by Baderd94 (Top 11 by date)

Baderd94 21-Aug-18 8:59am View    
Sorry I improved the question, It was not clear as I said add an icon to a dialog instead of a button in aq dialog.
Baderd94 21-Aug-18 8:59am View    
Sorry I improved the question, It was not clear as I said add an icon to a dialog instead of a button in aq dialog.
Baderd94 21-Aug-18 8:42am View    
Deleted
Hi, thank you for your reply. this code for setting an icon to a dialog not a button
Baderd94 2-Aug-18 14:12pm View    
I have the following code

for (int q =0; q< 19; q++)
{
SavePowerData[q] = TotalVoltage5s;
SaveTimeData[q] = TotalTime;
}

To store the data, then i have another function called onsavedata, in side this function i put the following

CString str10;
CFileDialog FileDlg10(FALSE," ","Power Log Data.txt",OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT , "TXT File(*.txt)|*.txt|All(*.*)|*.*|");
if(FileDlg10.DoModal()==IDOK)
{
ofstream ofs(FileDlg10.GetPathName());
ofs.write(str10,str10.GetLength());
ofs.close();
AfxMessageBox("Saved!");
}
else
{
AfxMessageBox("Failed to Save!");
}
ofstream PowerData(FileDlg10.GetPathName(), ios::out);

PowerData<<SavePowerData<<endl;

PowerData.close();
Baderd94 2-Aug-18 13:54pm View    
that is what i tried to do,

for (int q =0; q< 19; q++)
{
SavePowerData[q] = TotalVoltage5s;
}

but when i display the data, it gives no results so empty file, where SavePowerData is a global variable