Code for Dialog in C++
-
Hello. Ive asked this question before. Ive read tutorials, and looked online at google. The problem is, most of this assumes that you have knowledge of MFC, and programming with CDialog. I do not. Now I will present my problem. I have an ATM Gui type project. When I run this project, a dialog window pops up that has two buttons. These buttons are "Savings" and "Checking". When the "Savings" button is clicked, the Dialog window should SWITCH to the savings Dialog Window. This should also be the same for the "Checking" button. There is already a Checking and Savings class, and an ATM class, and each of them have their own Dialog Window. I have already used ClassWizard, and read tutorials, but I require some code. Anyone with knowledge in this area, anyone at all, I am begging for help. When I use class wizard, it makes two functions:
void CATM_gui1Dlg::OnChecking() { // TODO: Add extra validation here } void CATM_gui1Dlg::OnSavings() { // TODO: Add extra validation here }
I Dont know what code to put in there to "invoke the other class dialog windows." That is my question, what would the code be, or the functions be, to switch to other Dialog Windows once the button is clicked? :(( Mike -- I Code Because I love to -
Hello. Ive asked this question before. Ive read tutorials, and looked online at google. The problem is, most of this assumes that you have knowledge of MFC, and programming with CDialog. I do not. Now I will present my problem. I have an ATM Gui type project. When I run this project, a dialog window pops up that has two buttons. These buttons are "Savings" and "Checking". When the "Savings" button is clicked, the Dialog window should SWITCH to the savings Dialog Window. This should also be the same for the "Checking" button. There is already a Checking and Savings class, and an ATM class, and each of them have their own Dialog Window. I have already used ClassWizard, and read tutorials, but I require some code. Anyone with knowledge in this area, anyone at all, I am begging for help. When I use class wizard, it makes two functions:
void CATM_gui1Dlg::OnChecking() { // TODO: Add extra validation here } void CATM_gui1Dlg::OnSavings() { // TODO: Add extra validation here }
I Dont know what code to put in there to "invoke the other class dialog windows." That is my question, what would the code be, or the functions be, to switch to other Dialog Windows once the button is clicked? :(( Mike -- I Code Because I love to -
I seached in MSDN, and it told me what the functions do. Again, I am very new to all of this. What..would...the..code be so I could link the checking button to the checking dialog window, and the savings button to the savings dialog window. How would I use OpenFileName() and SaveFileName()? Mike -- I code because I love to
-
I seached in MSDN, and it told me what the functions do. Again, I am very new to all of this. What..would...the..code be so I could link the checking button to the checking dialog window, and the savings button to the savings dialog window. How would I use OpenFileName() and SaveFileName()? Mike -- I code because I love to
void CATM_gui1Dlg::OnSavings() {
char strDestFile[260] = "";
OPENFILENAME file;// Initialisation... ZeroMemory(&file, sizeof(file)); file.lStructSize = sizeof(file); file.hWndOwner = this\->m\_hWnd; file.lpstrFile = strDestFile; file.nMaxFile = sizeof(strDestFile); file.lpstrFilter = "Text files\\0\*.TXT\\0" "All files\\0\*.\*\\0"; file.nFilterIndex = 0; file.lpstrFileTitle = NULL; file.nMaxFileTitle = 0; file.lpstrInitialDir = NULL; file.Flags = OFN\_OVERWRITEPROMPT | OFN\_PATHMUSTEXIST; // Opens the dialog... if (GetSaveFileName(&file) == TRUE) { // Do whatever you want with the complete file // name and path contained into strDestFile... }
}
TOXCCT >>> GEII power
-
Hello. Ive asked this question before. Ive read tutorials, and looked online at google. The problem is, most of this assumes that you have knowledge of MFC, and programming with CDialog. I do not. Now I will present my problem. I have an ATM Gui type project. When I run this project, a dialog window pops up that has two buttons. These buttons are "Savings" and "Checking". When the "Savings" button is clicked, the Dialog window should SWITCH to the savings Dialog Window. This should also be the same for the "Checking" button. There is already a Checking and Savings class, and an ATM class, and each of them have their own Dialog Window. I have already used ClassWizard, and read tutorials, but I require some code. Anyone with knowledge in this area, anyone at all, I am begging for help. When I use class wizard, it makes two functions:
void CATM_gui1Dlg::OnChecking() { // TODO: Add extra validation here } void CATM_gui1Dlg::OnSavings() { // TODO: Add extra validation here }
I Dont know what code to put in there to "invoke the other class dialog windows." That is my question, what would the code be, or the functions be, to switch to other Dialog Windows once the button is clicked? :(( Mike -- I Code Because I love to -
I think you're getting the wrong end of the stick - he's talking about a Savings dialog - i.e. a dialog for his ATM application that shows the user's financial savings (not a file save dialog) -- Help me! I'm turning into a grapefruit! Phoenix Paint - back from DPaint's ashes!
-
Hello. Ive asked this question before. Ive read tutorials, and looked online at google. The problem is, most of this assumes that you have knowledge of MFC, and programming with CDialog. I do not. Now I will present my problem. I have an ATM Gui type project. When I run this project, a dialog window pops up that has two buttons. These buttons are "Savings" and "Checking". When the "Savings" button is clicked, the Dialog window should SWITCH to the savings Dialog Window. This should also be the same for the "Checking" button. There is already a Checking and Savings class, and an ATM class, and each of them have their own Dialog Window. I have already used ClassWizard, and read tutorials, but I require some code. Anyone with knowledge in this area, anyone at all, I am begging for help. When I use class wizard, it makes two functions:
void CATM_gui1Dlg::OnChecking() { // TODO: Add extra validation here } void CATM_gui1Dlg::OnSavings() { // TODO: Add extra validation here }
I Dont know what code to put in there to "invoke the other class dialog windows." That is my question, what would the code be, or the functions be, to switch to other Dialog Windows once the button is clicked? :(( Mike -- I Code Because I love toIf the Savings and the Cheking class are derived from CDialog (which they should be...) then take a look at CDialog::DoModal(). This will show the dialog in a modal state. (Information found in MSDN) If you want the ATM window to be invisible, then call ShowWindow(SW_HIDE) before the DoModal() call.. Hope this solves your problem. :-D Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.