Registry File
A registry file contains Creo-specific information about the application you want to load.
The registry file called creotk.dat or protk.dat is a simple text file, where each line consists of one predefined keyword followed by a value. The standard form of the creotk.dat or protk.dat file is as follows:
NAME otk_examples
TOOLKIT OBJECT [optional; omitted means protoolkit]
CREO_TYPE [optional; omitted means PARAMETRIC]
EXEC_FILE otk_examples_dll.dll
TEXT_DIR ./text
STARTUP dll [dll/spawn/java]
END
The fields of the registry file are as follows:
• name—Assigns a unique name to the Creo Object TOOLKIT C++ application. The name is used to identify the application if there is more than one. The name can be the product name and does not have to be the same as the executable name. This field has a limit of PRO_NAME_SIZE-1 wide characters (wchar_t).
• startup—Specifies the method Creo should use to communicate with the Creo Object TOOLKIT C++ application.
This field can take one of two values; spawn or dll.
◦ spawn—If the value is spawn, Creo starts the foreign program using interprocess communications.
◦ dll—If the value is dll, Creo loads the foreign program as a DLL.
The default value is spawn.
• toolkit—
Specifies the name of the Toolkit which was used to create the customization. The valid values for this field are object and protoolkit.
An application created in Creo Object TOOLKIT C++ must always have the value of this field set as object.
|
|
This field can also be used to indicate other toolkits. Its default value is protoolkit, which specifies that the customizing application was created in Creo TOOLKIT. If you set the value for this field as protoolkit, or omit this field, then the application can be used only with Creo Parametric.
|
• creo_type—
Specifies the Creo applications that support the Creo Object TOOLKIT C++ applications. The valid values for this field are:
◦ parametric—This is the default value. Specify parametric to load the Creo Object TOOLKIT C++ application in Creo Parametric.
|
|
Other Creo applications will be supported in future releases.
|
• fail_tol—Specifies the action of Creo if the call to user_initialize() in the foreign program returns non-zero, or if the foreign program subsequently fails. If this is TRUE, Creo continues as normal. If this field is missing or is set to FALSE, Creo shuts down the application and other foreign programs.
• exec_file—Specifies the full path and name of the file produced by compiling and linking the Creo Object TOOLKIT C++ application. In DLL mode, this field is a dynamically linkable library; in spawn mode, it is a complete executable. This field has a limit of PRO_PATH_SIZE-1 wide characters (wchar_t).
• text_dir—Specifies the full path name to text directory that contains the language-specific directories. The language-specific directories contain the message files, menu files, resource files and UI bitmaps in the language supported by the Creo Object TOOLKIT C++ application.
The text_dir does not need to include the trailing /text; it is added automatically by Creo.
The search priority for messages and menu files is as follows:
◦ Current working directory
◦ text_dir\text
◦ <creo_loadpoint>\Common Files\<datecode>\<machine type>\text
The text_dir should be different from the Creo text tree. This field has a limit of PRO_PATH_SIZE-1 wide characters (wchar_t).
• rbn_path—Specifies the name of the ribbon file along with its path, which must be loaded when you open the Creo application. The location of the ribbon file is relative to the location of the text directory. The field text_dir specifies the path for the text directory.
If the field is not specified, by default, the ribbon file with its location, text_dir/toolkitribbonui.rbn is used.
• delay_start—If you set this to TRUE, Creo does not invoke the Creo Object TOOLKIT C++ application as it starts up, but enables you to choose when to start the application. If this field is missing or is set to FALSE, the Creo Object TOOLKIT C++ application starts automatically.
• description—Acts as a help line for your auxiliary application. If you leave the cursor on an application in the Start/Stop GUI, Creo displays the description text (up to 80 characters). You can use non-ASCII characters, as in menu files.
To make the description appear in multiple languages, you must use separate protk.dat files in <hierarchy>/<platform>/<text>/<language>.
• allow_stop—If you set this to TRUE, you can stop the application during the session. If this field is missing or is set to FALSE, you cannot stop the application, regardless of how it was started.
• end—Indicates the end of the description of the Creo Object TOOLKIT C++ application. It is possible to add further statements that define other foreign applications. All of these applications are initialized by Creo.