Creo Toolkit Registry File
This section describes how to use the Registry file to have a foreign program communicate with Creo Parametric.
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 TOOLKIT 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 Parametric should use to communicate with the Creo TOOLKIT application.
This field can take one of three values; spawn, dll or java.
•  spawn— If the value is spawn, Creo Parametric starts the foreign program using interprocess communications.
•  dll – If the value is dll, Creo Parametric loads the foreign program as a DLL.
•  java – If the value is java, Creo Parametric starts the application as a J-Link class. Consult the J-Link User’s Guide for more details.
The default value is spawn.
fail_tol
Specifies the action of Creo Parametric 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 Parametric continues as normal. If this field is missing or is set to FALSE, Creo Parametric shuts down Creo Parametric and other foreign programs.
exec_file
Specifies the full path and name of the file produced by compiling and linking the Creo TOOLKIT 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 TOOLKIT application. Please refer to the User Interface: Menus, Commands, and Popupmenus and User Interface: Messages sections for more information.
The text_dir does not need to include the trailing /text; it is added automatically by Creo Parametric.
The search priority for messages and menu files is as follows:
1. Current working directory
2. text_dir\text
3. <creo_loadpoint>\<version>\Common Files\$<machine type>\text, where <machine_type> is the machine-specific subdirectory, such as, i486_nt or x86e_win64. Set the environment variable PRO_MACHINE_TYPE to define the type of machine on which Creo Parametric is installed.
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 Creo Parametric. 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 app1_rbn.rbn placed at text_dir/app1/app1_rbn.rbn, specify rbn_path as app1/app1_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 Parametric does not invoke the Creo TOOLKIT 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 TOOLKIT 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 Parametric 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 TOOLKIT application. It is possible to add further statements that define other foreign applications. All of these applications are initialized by Creo Parametric.
Sample Registry Files
This section lists several examples that illustrate the various ways to have a foreign program communicate with Creo Parametric.
Example 1
In this example, Creo Parametric spawns the foreign program, which runs on the same machine. The communication is via pipes (the default mode when the foreign program runs on the same machine as Creo Parametric).
File: protk.dat
[Start of file on next line]
name       Product1 
exec_file  /home/protk/$<machine_type>/obj/frnpgm1 
text_dir   /home/protk
end
[End of file on previous line]
Example 2
This example illustrates how to run multiple foreign programs, as specified in the protk.dat file.
File: protk.dat
[Start of file on next line]
name        Product1
startup     dll
exec_file   /home/protk/$<machine_type>/obj/frnpgm1.dll 
text_dir    /home/protk
end
name        Product2
startup     spawn
exec_file   /home/protk2/$<machine_type>/obj/frnpgm2 
text_dir    /home/protk2
end
[End of file on previous line]