
3-16 Creating an Extension
3-16
Create & Register the DLL
When you build your project, you must implement it as a 32-bit
Dynamic Link Library (DLL). This DLL must contain code for your
extension, a ClassFactory to create your extensions, and a
DllRegisterServer entry point.
The Extension Development Kit provides extsdk.cpp, which
contains a ClassFactory and an implementation of
DllRegisterServer. If you use this ClassFactory, you must include
this file in your project.
You can register your DLL on the Extensions tab of the Session
Preferences property view.
Debug the Extension
You can debug your extension by putting a call to the Win32
function DebugBreak in your code. When HYSYS executes this
part of your code, you are allowed to start your debugger and
debug the code from there. You are then able to inspect
variables, and trace the execution of your extension's code. You
can also debug your extension in MS DevStudio by setting
breakpoints in the code. Specifying the path of the HYSYS
executable file in the Executable for debug session field on the
Debug tab of the Project Settings property view and launch
VC++ auto debug.
You can load your extension by starting HYSYS and creating an
instance of the extension. HYSYS creates a container, and this
container then calls the extension's Initialize method.
Distribute the Extension
Once you are confident that your extension is behaving properly,
you can create an ActiveX DLL file. The end result of this step is
an extension that you can distribute without exposing any
proprietary information or methods.
For more information on
extension registration
see Section 3.6 -
Registering
Extensions.
Komentáře k této Příručce