Help! need some tutorials on dialogs in an NONE dialog based application
-
Hi there, I have tried to get a dialog to transfer data from a combobox into the view class member but I havent been able to get it to work get crashes. All I want is a tutorial on how to change som variables in a dialog that effects the members of the view class. This must be a ordinary thing that must want to achive. Every windows program has dialogs to set alot of options etc. Hope you got something for me!.) regards Peter
-
Hi there, I have tried to get a dialog to transfer data from a combobox into the view class member but I havent been able to get it to work get crashes. All I want is a tutorial on how to change som variables in a dialog that effects the members of the view class. This must be a ordinary thing that must want to achive. Every windows program has dialogs to set alot of options etc. Hope you got something for me!.) regards Peter
Hi I understand your problem is to accept user input through a dialog and get those data in the View class of a SDI/MDI, is that so ? Then you could try doing this, Insert a Dialog into the project. Add the control you want on the dialog. Now add a class CUserDlg for the dialog, deriving it from CDailog. Add member functions like GetName, GetAge, GetGender etc to the CUserDlg, these should return the data that you want to pass to the view class. Now create a memberf m_dlgUserData of type CUserDlg in the View Class. Call DoModal to display the Dialog and when finished (ie pressed ok) Call m_dlgUserData.GetAge(), to get the age of the user. This way you get the age of the user entered in the dialog into the View Class. Hope I answered your question... Regards The Best Relligion is Science. Once you understand it, you will know God.
-
Hi there, I have tried to get a dialog to transfer data from a combobox into the view class member but I havent been able to get it to work get crashes. All I want is a tutorial on how to change som variables in a dialog that effects the members of the view class. This must be a ordinary thing that must want to achive. Every windows program has dialogs to set alot of options etc. Hope you got something for me!.) regards Peter
The simplest way of transfering data between dialogs and views. Is to pass a pointer to the view class into the dialog class either via the constructor or via a method that is called before DoModal. In the constructor, assign the view pointer to a class member variable and then you can call view methods in any of your dialog methods. Michael CP Blog [^]