Save as.. and open
-
Hi, I'd like to make the button save as.. and load, but I think that maybe this button is made in visual as activeX or something like that. Do you know if it is made already?
-
Hi, I'd like to make the button save as.. and load, but I think that maybe this button is made in visual as activeX or something like that. Do you know if it is made already?
antonio343 wrote:
I'd like to make the button save as.. and load, but I think that maybe this button is made in visual as activeX or something like that.
Where do you want to put a button save-as or load ? dialog ? menu ? toolbar ? And, adding a button for the save-as and load will not actually do all the code ... just sayin' M.
Watched code never compiles.
-
Hi, I'd like to make the button save as.. and load, but I think that maybe this button is made in visual as activeX or something like that. Do you know if it is made already?
Just add them to your toolbar, and then add the code handlers for both items as required.
Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman
-
Just add them to your toolbar, and then add the code handlers for both items as required.
Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman
I'd like to add this button in a dialog. But I dnt know where are these button or if its ones is already made
-
Hi, I'd like to make the button save as.. and load, but I think that maybe this button is made in visual as activeX or something like that. Do you know if it is made already?
If you're talking about using the Windows common dialog for "Save As..." or "File Open" then look at CFileDialog[^] if you're using MFC or the Common Items Dialog[^] when using just the WinAPI.
-
I'd like to add this button in a dialog. But I dnt know where are these button or if its ones is already made
-
If you're talking about using the Windows common dialog for "Save As..." or "File Open" then look at CFileDialog[^] if you're using MFC or the Common Items Dialog[^] when using just the WinAPI.
Yes Im using mfc, then I must look CFileDialog?
-
Yes Im using mfc, then I must look CFileDialog?
Yes... you can still use the WinAPI directly, but using MFC classes is generally easier.
-
Hi, I'd like to make the button save as.. and load, but I think that maybe this button is made in visual as activeX or something like that. Do you know if it is made already?
antonio343 wrote:
Do you know if it is made already?
Oy vey, you want to know how it is made already! :) Anyway, jewish language jokes aside, you add buttons to your dialog though the UI editor in MFC, bring up the toolbar, drag and drop a button where you want it, give it a meaningfull ID, add a handler, add the code. If that is too much, do a basic tutorial in MFC.
============================== Nothing to say.
-
I'd like to add this button in a dialog. But I dnt know where are these button or if its ones is already made
What do you mean "already made"? If you are creating an application then you should know that all toolbar or dialog buttons have to be added to the project by you. In both cases the Visual Studio Framework does most of the hard work for you; all you have to do is use the designer to drag items to the right place.
Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman
-
antonio343 wrote:
Do you know if it is made already?
Oy vey, you want to know how it is made already! :) Anyway, jewish language jokes aside, you add buttons to your dialog though the UI editor in MFC, bring up the toolbar, drag and drop a button where you want it, give it a meaningfull ID, add a handler, add the code. If that is too much, do a basic tutorial in MFC.
============================== Nothing to say.
I remember this user from before stating he was just starting to learn to use MFC plus he's not a native English speaker... So, we need to be patient with the new ones... :)
-
antonio343 wrote:
Do you know if it is made already?
Oy vey, you want to know how it is made already! :) Anyway, jewish language jokes aside, you add buttons to your dialog though the UI editor in MFC, bring up the toolbar, drag and drop a button where you want it, give it a meaningfull ID, add a handler, add the code. If that is too much, do a basic tutorial in MFC.
============================== Nothing to say.
I'm sorry, I didn't understand very well what you said. What do you mean? I have a button in a dialog, which I'd like to be the open botton (Load). I know that in the toolbar there are this button but they haven't code only BEGIN_MESSAGE_MAP(CAdestApp, CWinAppEx) ON_COMMAND(ID_FILE_OPEN, &CWinAppEx::OnFileOpen) ..
-
I remember this user from before stating he was just starting to learn to use MFC plus he's not a native English speaker... So, we need to be patient with the new ones... :)
Could you show me how to use to load/save file with CFileDialog?? I dont find some example
-
Could you show me how to use to load/save file with CFileDialog?? I dont find some example
Gotta learn the joy of Google / Bing. Simple search for CFileDialog(), 2nd returned result was a tutorial. CFileDialog()[^] You'd find it a lot faster yourself rather than wait around for somebody to post an answer.
-
I'm sorry, I didn't understand very well what you said. What do you mean? I have a button in a dialog, which I'd like to be the open botton (Load). I know that in the toolbar there are this button but they haven't code only BEGIN_MESSAGE_MAP(CAdestApp, CWinAppEx) ON_COMMAND(ID_FILE_OPEN, &CWinAppEx::OnFileOpen) ..
So add a handler. In the dialog editor double click the button, this will present you with a class::name() combo, normally you can accept it, but yiou can change the name if you like. CLick OK, then the code will be created for you (empty code, consisting of just the name and perhaps a return). You then add the code you like to this handler to get it to do something interesting.
============================== Nothing to say.
-
Gotta learn the joy of Google / Bing. Simple search for CFileDialog(), 2nd returned result was a tutorial. CFileDialog()[^] You'd find it a lot faster yourself rather than wait around for somebody to post an answer.
I'm triying to do this:
void CDlgResultados::SaveToFile(void)
{
this->UpdateData();CFile f; CString strFilter =\_T("\*.txt"); CFileDialog FileDlg(FALSE, \_T(".txt"), NULL, 0, strFilter); if( FileDlg.DoModal() == IDOK ) { f.Open(FileDlg.GetFileName(), CFile::modeCreate | CFile::modeWrite); CArchive ar(&f, CArchive::store); ar << cadena; ar.Close(); } else return; f.Close();
}
Everything run well, but it function save the file in the folder of my project and not when I want. what happen?
-
I'm triying to do this:
void CDlgResultados::SaveToFile(void)
{
this->UpdateData();CFile f; CString strFilter =\_T("\*.txt"); CFileDialog FileDlg(FALSE, \_T(".txt"), NULL, 0, strFilter); if( FileDlg.DoModal() == IDOK ) { f.Open(FileDlg.GetFileName(), CFile::modeCreate | CFile::modeWrite); CArchive ar(&f, CArchive::store); ar << cadena; ar.Close(); } else return; f.Close();
}
Everything run well, but it function save the file in the folder of my project and not when I want. what happen?
GetFileName() only returns the file name portion. GetPathName() returns the whole file specification. See the docs at http://msdn.microsoft.com/en-us/library/5b9c3c1f(v=VS.80).aspx[^]
-
GetFileName() only returns the file name portion. GetPathName() returns the whole file specification. See the docs at http://msdn.microsoft.com/en-us/library/5b9c3c1f(v=VS.80).aspx[^]
Ok, thank you very much Everything run right