Missing OnInitDialog()
-
I am using C/C++, Visual Studio 6.0 I hsve created a Dialog-based app. I have several Dialog boxes each with it's own Class. When I have done this, VS nicely creates an OnInitDialog() function for each Class. Somehow, on the last Dialog Box / Class that I created, the OnInitDialog() function did not show up. Any help on creating an OnInitDialog(0 function would be greatly appreciated :-) Many thanks, Robert
-
I am using C/C++, Visual Studio 6.0 I hsve created a Dialog-based app. I have several Dialog boxes each with it's own Class. When I have done this, VS nicely creates an OnInitDialog() function for each Class. Somehow, on the last Dialog Box / Class that I created, the OnInitDialog() function did not show up. Any help on creating an OnInitDialog(0 function would be greatly appreciated :-) Many thanks, Robert
Robert Palma Jr. wrote: Somehow, on the last Dialog Box / Class that I created, the OnInitDialog() function did not show up. Any help on creating an OnInitDialog(0 function would be greatly appreciated How about copying and adapting what you have in the other dialogs? This is what you need: 1. Declare OnInitDialog as a member of your dialog class. Add it in the dialog header file (the .h file). It's something like this:
virtual BOOL OnInitDialog();
2. Provide an implementation for YourDialog::OnInitDialog(). Add it to your dialog implementation file (the .cpp file). Something like this:
BOOL YourDialog::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
}That should be enough. -- jlr http://jlamas.blogspot.com/[^]
-
I am using C/C++, Visual Studio 6.0 I hsve created a Dialog-based app. I have several Dialog boxes each with it's own Class. When I have done this, VS nicely creates an OnInitDialog() function for each Class. Somehow, on the last Dialog Box / Class that I created, the OnInitDialog() function did not show up. Any help on creating an OnInitDialog(0 function would be greatly appreciated :-) Many thanks, Robert
More comfortably, use Class wizard and then select the class you created then add windows message WM_INITDIALOG. This will add the OnInitDialog() function in your class. Work hard and a bit of luck is KEY to SUCCESS.
-
Robert Palma Jr. wrote: Somehow, on the last Dialog Box / Class that I created, the OnInitDialog() function did not show up. Any help on creating an OnInitDialog(0 function would be greatly appreciated How about copying and adapting what you have in the other dialogs? This is what you need: 1. Declare OnInitDialog as a member of your dialog class. Add it in the dialog header file (the .h file). It's something like this:
virtual BOOL OnInitDialog();
2. Provide an implementation for YourDialog::OnInitDialog(). Add it to your dialog implementation file (the .cpp file). Something like this:
BOOL YourDialog::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
}That should be enough. -- jlr http://jlamas.blogspot.com/[^]
Many thanks Jose :-)
-
More comfortably, use Class wizard and then select the class you created then add windows message WM_INITDIALOG. This will add the OnInitDialog() function in your class. Work hard and a bit of luck is KEY to SUCCESS.
Many thanks Neelesh :-)