Procedure
- In the browser, right-click the component
whose main file you want to edit.
- Select to create a file.
- Name the new file (for example,
myMain
).
- Open the Features window for
myMain
and
set the File Type field to Logical or Implementation.
- Select the Properties tab.
- Click OK.
- Right-click the active configuration for
the component (used to build the application) and then select Edit
Configuration Main File.
- Copy the contents of this file, including
the header files.
- Open the Features window for
myMain
and
click Add Text.
- Paste the code from the generated main file
into the Text Element field.
- Customize the code as wanted.
- Click OK.
- Set the following properties for the configuration:
- Set
CG::Configuration::MainGenerationScheme
to UserInitializationOnly
.
This property controls how the main
is generated.
- Set
<lang>_CG::<Environment>::EntryPoint
to myMain
.
This property specifies the name of the main
program.
Results
Now when you compile the application, the
product compiles your customized main
instead of
generating a new one.