User's Guide > Overview of Object TOOLKIT C++ > How Creo Object TOOLKIT C++ Works
How Creo Object TOOLKIT C++ Works
The standard method by which Creo Object TOOLKIT C++ application code is integrated into Creo application is through the use of dynamically linked libraries (DLLs). When you compile your Creo Object TOOLKIT C++ application code and link it with the Creo Object TOOLKIT C++ libraries, you create an object library file designed to be linked into the Creo executable when the Creo application starts up. This method is referred to as DLL mode.
Creo Object TOOLKIT C++ also supports a second method of integration: the multiprocess or spawned mode. In this mode, the Creo Object TOOLKIT C++ application code is compiled and linked to form a separate executable. This executable is designed to be spawned by Creo application and runs as a child process of the Creo session. In DLL mode, the exchanges between the Creo Object TOOLKIT C++ application and Creo application are made through direct function calls. In multiprocess mode, the same effect is created by an inter-process messaging system that simulates direct function calls by passing the information necessary to identify the function and its argument values between the two processes.
Multiprocess mode involves more communications overhead than DLL mode, especially when the Creo Object TOOLKIT C++ application makes frequent calls to Creo Object TOOLKIT C++ library functions, because of the more complex method of implementing those calls. However, it offers the following advantage: it enables you to run the Creo Object TOOLKIT C++ application with a source-code debugger without even loading the whole Creo executable into the debugger.
You can use a Creo Object TOOLKIT C++ application in either DLL mode or multiprocess mode without changing any of the source code in the application. It is also possible to use more than one Creo Object TOOLKIT C++ application within a single session of Creo application, and these can use any combination of modes.
If you use multiprocess mode during development of your application to debug more easily, you should switch to DLL mode when you install the application for your end users because the performance is better in that mode. However, take care to test your application thoroughly in DLL mode before you deliver it. Any programming errors in your application that cause corruption to memory used by Creo or Creo Object TOOLKIT C++ are likely to show quite different symptoms in each mode, so new bugs may be found when you switch to DLL mode.
Although multiprocess mode involves two processes running in parallel, these processes do not provide genuine parallel processing. There is, however, another mode of integrating the Creo Object TOOLKIT C++ application that provides this ability, called “asynchronous mode”. The DLL and multiprocess modes are given the general name “synchronous mode”. An asynchronous Creo Object TOOLKIT C++ application is fundamentally different in its architecture from a synchronous mode application, so you should choose between these methods before writing any application code. As a general rule, synchronous mode should be the default choice unless there is some unavoidable reason to use asynchronous mode, because the latter mode is more complex to use.
* 
All Creo Object TOOLKIT C++ calls running in either synchronous (DLL or multiprocess) mode or asynchronous mode always clear the Undo/Redo stack in the Creo session. The Creo user interface reflects this by making the Undo and Redo menu options unavailable.
Was this helpful?