Explain the significance of InitApplication() in VC++. What is command routing in VC++? Explain its significance
Explain the significance of InitApplication() in VC++.
InitApplication() function is a Boolean method to display an output. This gives output as true if application executes correctly or else it gives an error. This function calls RegisterWindow() which registers the components used in the program or in the execution. The representation of it is as follows:
MSG msg;
If ( ! InitApplication (hInstance))
return(false);
where the hInstance is the handle that identifies the current instance of the application and it takes the current executing parameters.
What is command routing in VC++? Explain its significance
The commands working are having limitation to make message-map connections between commands and their handler functions. Command messages are mostly routed to its class objects or other objects but windows messages are usually sent to the main frame window. The framework is used to route commands through a standard sequence of command-target objects. In return command-target checks its message map to see if it can handle the incoming message or not. Order in which command-target routes command is:-
To its currently active child command-target object.
To itself.
To other command targets.
This mechanism of command routing reduces the overall cost which would have increased if it would have been done without this interface because the framework generates commands only when it interfaces with the user.