Gadgets > Rogue Wave Views Application Framework > Implementing an Application > Main File
 
Main File
When you create an Application Framework application, you must first create an IlvDvApplication object in the main procedure, the same way you create an IlvApplication object in a simple Rogue Wave® Views application:
Note: The main file is automatically generated using the Application Framework Editor.
int
main(int argc, char* argv[])
{
IlvDvApplication* app = new IlvDvApplication("", 0, argc, argv);
IlvDisplay* display = app->getDisplay();
if (!display || display->isBad()) {
IlvFatalError("Couldn't create display");
delete display;
return -1;
}
// Adding the options file
app ->setAppOptionsFilename((const char*)"myapp.odv");
 
// Adding the data base file
display->getDatabase()->read((const char*)"myapp.dbm", display);
 
// Continue...
application->run();
return 0;
}
IlvDvApplication is a subclass of IlvApplication and features management of options data and the handling of menu and toolbar items, as well as actions and their states.
Most of all, this IlvDvApplication object is aware of all objects involved in the Document/View mechanism (see Figure 21.1). Similarly, all these objects are aware of the application object. The application object is useful, for example, when changing the state of an action from a document or from a document view.

Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.