Реферат: Системне програмне забезпечення С
char filter[] = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*|";
CFileDialog dlg(FALSE, "*.txt",NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,filter);
if (dlg.DoModal() == IDOK)
{
FILE *f = fopen(dlg.GetPathName(), "wt");
if (f == NULL)
{
AfxMessageBox("Can'topen file");
return;
}
char acBuf[400];
if (fMatrFilled)
{
Calc();
::wsprintf(acBuf, "Result = %d", result);
}
else
::strcpy(acBuf, "Matrix has not inputed");
fputs(acBuf, f);
::wsprintf(acBuf, "File : %s succesfully saved", dlg.GetPathName());
MessageBox(acBuf, "File Saving",
MB_ICONEXCLAMATION | MB_OK);
fclose(f);
}
}
Delete
void CPashaWnd::OnFDelete()
{ char filter[] = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*|";
CFileDialog dlg(TRUE,"*.txt",NULL,OFN_HIDEREADONLY, filter);