What is the use of OninitDialog ?
Answers were Sorted based on User's Feedback
Answer / suyambu
All your initialization for your dialog can be
inside "OnInitDialog". Basically to set default / preset
values to your dialog controls.
| Is This Answer Correct ? | 29 Yes | 2 No |
Answer / satheesh kumar
OnInitDialog() is a virtual function.It is called just
before the dialog box is displayed.It initializes the dialog
box controls.We can override this function in our derived
dialog class.
| Is This Answer Correct ? | 10 Yes | 1 No |
Answer / chaitanya shah
OnInitDialog method is Overridable in CDialog. For dialog
based application class is derived from CDialog. If class
is derived from CDialog then it need to define InitDialog
Method.It is first method which called when dialog DoModle
method called.
| Is This Answer Correct ? | 6 Yes | 3 No |
Answer / bijender singh
OninitDialog() will do the initialization of all the
controls on dialog before displaying the dialog.
| Is This Answer Correct ? | 5 Yes | 2 No |
Answer / songeetha
OnInitDialog is a inbuilt MFC function for all classes that
user creates. This function is overwritten by the user for
intial changes.
The initial updates for the classes or for dialogs can be
done through this function.
This function can be invoked automatically whenever that
class has been called or invoked from another class.
| Is This Answer Correct ? | 7 Yes | 5 No |
Answer / rck
OnInitDialog() function is called only once after the dialog is created and before the dialog is displayed.
we can use like to set the window title bar,to set the focus to the control etc....
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / pavan
OnInitDialog is an overridable function that's called just before the dialog is drawn /shown. This is the function where the dialog controls can be set with data, such as Combobox items and it's selection (not necessarily at 0 index), text in the editbox etc
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / ram 9885422717 from mlg
the name itself says the meaning On means actavate,init
means INITIALIZATIOn dialog is nothing but a window with
built in(already exist) buttons.
so when ever this function is occured it will activate the
initializations of dialog.this is the function where we can
initialize the variables of the dialog.
| Is This Answer Correct ? | 4 Yes | 3 No |
OnInitDialog() is a virtual function.It is called just
before the dialog box is displayed.It initializes the dialog
box controls.We can override this function in our derived
dialog class. By default , it returns TRUE
Ex:-
BOOL CMyDialog::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_cMyEdit.SetWindowText("My Name"); // Initialize control values
m_cMyList.ShowWindow(SW_HIDE); // Show or hide a control, etc.
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / sk
OninitDialog is default one present in CDialog class.In this
we can add controls like buttons and we can draw the area
by using OnDraw fuction.In sdi & mdi class we have to add
the function by using OnInitialUpdate or WM_INTIDIALOG.
| Is This Answer Correct ? | 1 Yes | 1 No |
what is message Testing ?
How to find the mouse entering an image?..while entering need to display next image...
1)How to change a text of a button as Dynamically?
What is the difference between Struts and JSF? Pls list some most suitable differences.
if both base and derived class have the constructors if i create an object for derive class which class constructor is executed first
What are the advantages of using Doc/View or SDI over DialogBox
Hi All, I have created one MFC Dialog Based application.now if i am running the application its working fine,instead of closing he application i minimized the application,if i run the application again,i am getting the Dialog. I want to prevent the calling of application multiple times. please give me the code and let me know in which method i need to make changes. Praveer
Why not virtual functions to handle messages?
Q1. A. What is unary operator? List out the different operators involved in the unary operator. B. What is an adjust field format flag? Q2. A. Distinguish between a # include and #define. B. Can a list of string be stored within a two dimensional array? Q3. A. Explain how a pointer to function can be declared in C++? B. List the merits and demerits of declaring a nested class in C++? Q4. A. What are the syntactic rules to be avoid ambiguity in multiple inheritence? B. Explain the operation of overloading of an assignment operator. Q5. A. Explain how the virtual base class is different from the conventional base classes of the opps. B. Explain how an exception handler is defined and invoked in a Program. Q6. A. What is a binary file? List the merits and demerits of the binary file usagein C++. B. Write short notes on Text Manipulation Routines. C. Write bites in Turbo c++ Header ("Include") Files.
How we call a dialog in another dialog?
what do you mean by psychic window?
List out the basic features of MFC.