VC++, save command

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

calculus87

Thread Starter
Joined
Sep 4, 2003
Messages
34
Hello,
This is what I would like to do. I would like to make a save command. I would like it to look just like the one in Microsoft word when you click on the "save as" button. This is the code that I have, but it is for the open command, not the save command. I would like to know what the key words for the save as command are.
Thank you very much for your time.
Ronald

void CTry4Dlg::OnButton4()
{
OPENFILENAME ofn = {0};
char szName[MAX_PATH];
*szName = 0;
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = AfxGetApp()->m_pMainWnd->m_hWnd;
ofn.lpstrFilter = NULL;
ofn.lpstrFilter = "Text files (*.txt)\0*.txt\0All files (*.*)\0*.*\0";
ofn.lpstrCustomFilter = NULL;
ofn.nFilterIndex = 1;
ofn.lpstrFile = &szName[0];
ofn.nMaxFile = MAX_PATH;
ofn.lpstrInitialDir = m_DefaultDir;
ofn.lpstrTitle = "Open Text File";
ofn.lpstrFileTitle = NULL;
ofn.lpstrDefExt = "TXT";
ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_PATHMUSTEXIST | OFN_EXPLORER;

if (GetOpenFileName(&ofn))
transfile1= ofn.lpstrFile;
CEdit* pEditShow = (CEdit*)GetDlgItem(IDC_EDIT4);
pEditShow->SetWindowText(transfile4);
}
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top