The SFTBOX_STATIC preprocessor symbol selects static linking of SftBox/DLL to an application.
#define SFTBOX_STATIC
The SFTBOX_STATIC preprocessor symbol selects static linking of SftBox/DLL to an application. An application that links statically includes the combo box control code in its executable and does not need the SftBox/DLL DLL files at run-time.
The symbol must be defined before the header file SftBox.h is included, preferably using the project's preprocessor definitions, so all source files use the same setting.
SftBox.h automatically adds the required Lib file to the application (Microsoft Visual C++). SFTBOX_STATIC determines which Lib file is used:
| Platform | Character Set | SFTBOX_STATIC defined | SFTBOX_STATIC not defined |
|---|---|---|---|
| x64 | Unicode | SftBox_x64_U_60_Static.lib | SftBox_x64_U_60.lib |
| x64 | ANSI | SftBox_x64_A_60_Static.lib | SftBox_x64_A_60.lib |
| Win32 (x86) | Unicode | SftBox_IX86_U_60_Static.lib | SftBox_IX86_U_60.lib |
| Win32 (x86) | ANSI | SftBox_IX86_A_60_Static.lib | SftBox_IX86_A_60.lib |
| ARM64 | Unicode | Not available | SftBox_ARM64_U_60.lib |
| ARM64 | ANSI | Not available | SftBox_ARM64_A_60.lib |
There is no static library for ARM64. Defining SFTBOX_STATIC in an ARM64 build causes a compile-time error, unless the automatic Lib file selection is suppressed using SFTBOX_NOAUTOLIB.
The Unicode Lib files are used if UNICODE or _UNICODE is defined, otherwise the ANSI Lib files are used. An application that prefers to add the Lib file to its linker settings can define the SFTBOX_NOAUTOLIB preprocessor symbol before including SftBox.h, which suppresses the automatic selection.
As for an application using the DLL, RegisterApp must be called before a combo box control is created and UnregisterApp when the application no longer uses combo box controls. In a statically linked application, RegisterApp registers the combo box window class (SFTBOX_CLASS) for the application instance passed to it, so the window class is only available to that application instance. The window class is removed once every RegisterApp call has been matched by an UnregisterApp call.
A statically linked application must also include the resources of the combo box control in its resource script, using the resource include file SftBoxResources.rci (see Building Applications).
See Also C/C++ API | Categories | Notifications