The methods described in this section enable a Creo Object TOOLKIT Java user to register and launch a Creo TOOLKIT DLL from a Creo Object TOOLKIT Java application. The ability to launch and control a Creo TOOLKIT application enables the following:
|
• |
Reuse of existing Creo TOOLKIT code with Creo Object TOOLKIT Java applications. |
Methods Introduced:
Use the method pfcSession.BaseSession.LoadProToolkitDll to register and start a Creo TOOLKIT DLL. The input parameters of this method are similar to the fields of a registry file and are as follows:
|
• |
ApplicationName—The name of the application to initialize. |
|
• |
DllPath—The full path to the DLL binary file. |
|
• |
TextPath—The path to the application’s message and user interface text files. |
|
• |
UserDisplay—Set this parameter to true to register the application in the Creo user interface and to see error messages if the application fails. If this parameter is false, the application will be invisible to the user. |
The application's user_initialize() function is called when the application is started. The method returns a handle to the loaded Creo TOOLKIT DLL.
In order to register and start a legacy Pro/TOOLKIT DLL that is not Unicode-compliant, use the method pfcSession.BaseSession.LoadProToolkitLegacyDll. This method conveys to Creo Parametric that the loaded DLL application is not Unicode-compliant and built in the pre-Wildfire 4.0 environment. It takes the same input parameters as the earlier method pfcSession.BaseSession.LoadProToolkitDll.
Note
The method pfcSession.BaseSession.LoadProToolkitLegacyDll must be used only by a pre-Creo Object TOOLKIT Java application to load a pre-Wildfire 4.0 Pro/TOOLKIT DLL.
Use the method pfcSession.BaseSession.GetProToolkitDll to obtain a Creo TOOLKIT DLL handle. Specify the Application_Id, that is, the DLL’s identifier string as the input parameter of this method. The method returns the DLL object or null if
the DLL was not in session. The Application_Id can be determined as follows:
|
• |
Use the function ProToolkitDllIdGet() within the DLL application to get a string representation of the DLL application. Pass NULL to the first argument of ProToolkitDllIdGet() to get the string identifier for the calling application. |
|
• |
Use the Get method for the Id attribute in the DLL interface. The method pfcProToolkit.Dll.GetId() returns the DLL identifier string. |
Use the method pfcProToolkit.Dll.ExecuteFunction to call a properly designated function in the Creo TOOLKIT DLL library. The input parameters of this method are:
|
• |
FunctionName—Name of the function in the Creo TOOLKIT DLL application. |
|
• |
InputArguments—Input arguments to be passed to the library function. |
The method returns an object of interface com.ptc.pfc.pfcProToolkit.FunctionReturn. This interface contains data returned by a Creo TOOLKIT function call. The object contains the return value, as integer, of the executed function and the output arguments passed
back from the function call.
The method pfcProToolkit.Dll.IsActive determines whether a Creo TOOLKIT DLL previously loaded by the method pfcSession.BaseSession.LoadProToolkitDll is still active.
The method pfcProToolkit.Dll.Unload is used to shutdown a Creo TOOLKIT DLL previously loaded by the method pfcSession.BaseSession.LoadProToolkitDll and the application's user_terminate() function is called.