Creo Object TOOLKIT C++ Registry File
This section describes how to use the Registry file to have a foreign program communicate with Creo.
Note
The Creo Object TOOLKIT C++ applications are supported with Creo Parametric and Creo Direct.
Registry File
The registry file is a simple text file, where each line consists of one keyword from a predefined set of keywords, followed by a value.
Registry File Fields
The following table lists the fields in the registry file creotk.dat or protk.dat.
Field
Description
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.
Note
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 Parametric 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.
•  direct—Specify direct to load the Creo Object TOOLKIT C++ application in Creo Direct.
Note
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 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. Please refer to the Ribbon Tabs, Groups, and Menu Items section for more information.
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:
1. Current working directory
2. text_dir\text
3. <creo_loadpoint>\Common Files\<datecode>\<machine type>\text
The text_dir should be different from the Creo Parametric 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. For example, if you want to specify a ribbon file dma_rbn.rbn placed at text_dir/dma/dma_rbn.rbn, specify rbn_path as dma/dma_rbn.rbn.
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.
Sample Registry Files
This section shows an example that illustrates the various ways to have a foreign program communicate with Creo.
Example 1
File: creotk.dat
[Start of file on next line]
NAME 			          otk_examples
TOOLKIT                     OBJECT [optional; omitted means protoolkit]
CREO_TYPE               DIRECT [optional; omitted means PARAMETRIC] 
EXEC_FILE                 otk_examples_dll.dll
TEXT_DIR                   ./text
STARTUP                   dll [dll/spawn/java]
END 
[End of file on previous line]