Advertisement
Advertisement
| 04.01.2008 at 07:37AM PDT, ID: 23285883 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: |
void CMainDlg::OnRead2()
{
int result;
CString new_file_name[10];
GetDlgItemText(IDC_TEXTBOX, new_name[10]);
CString old_path_name = "C:\\OldLocation\\old_file_name.jpg";
CString new_path_name = "C:\\NewLocation\\" + new_file_name[10] + ".jpg";
int iRet;
iRet = AfxMessageBox("Save the new file with the name = " + new_file_name[10] + "?",MB_OKCANCEL);
if(iRet == IDOK)
{
result= rename( old_path_name , new_path_name );
if (result != 0 )
{
AfxMessageBox("Cannot rename file. File may already exists on C drive.");
}
else
{
AfxMessageBox("The new file " + new_file_name[10] + " has been saved to C.");
}
}
}
|