SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
This section describes how to use SftPrintPreview/DLL in an application written using the C programming language.
Please see "Building Applications" to prepare a project for development with SftPrintPreview/DLL.
A) | Every source program making use of a SftPrintPreview/DLL control must include the required header file SftPrintPreview.h by using the #include directive. |
---|
#include "SftPrintPreview.h" /* SftPrintPreview/DLL required header file */
This include statement should appear after the #include <windows.h> statement. The file is located in the directory \Program Files\Softelvdm\SftPrintPreview DLL 2.0\Include (unless changed during the installation).The project settings may need to be updated so the #include file can be located.
B) | In order to use SftPrintPreview/DLL controls, an application must call the SftPrintPreview_RegisterApp function. The call to this function is required so that SftPrintPreview/DLL window classes can be registered. This call has to be made before any SftPrintPreview/DLL controls are created. Add the following statement to your source code, where your application registers its window classes (normally during application initialization): |
---|
SftPrintPreview_RegisterApp(hInstance); /* Use SftPrintPreview/DLL with this application */
C) | Once SftPrintPreview/DLL controls are no longer needed, an application must call the SftPrintPreview_UnregisterApp function. The call to this function is required so that SftPrintPreview/DLL window classes can be unregistered and cleanup processing can take place. This call has to be made after all SftPrintPreview/DLL controls have been destroyed (normally during application termination). |
---|
SftPrintPreview_UnregisterApp(hInstance); /* No longer use SftPrintPreview/DLL */
D) | The application's executable (Exe or Dll) must be linked with the correct Lib file, depending on the target environment. Please see "Building Applications" for more information.The project settings may need to be updated so the Lib files can be located (see "Building Applications" for more information). |
---|
There are two methods to add a Print Preview control to an application:
Adding a Print Preview control using dialog resources is accomplished by using a resource editor to design a dialog. Once a Print Preview control is created, its window handle can be obtained by using the Windows GetDlgItem function. For more information, see Creating a Dialog Resource with Visual C++.
Another method to create a Print Preview control is by using the CreateWindow(Ex) Windows call:
hwndPreview = CreateWindow(TEXT(SFTPRINTPREVIEW_CLASS), NULL, WS_CHILD, 0, 0, 0, 0, hwndMain, (HMENU) IDC_PREVIEW, hInstance, NULL);
For more information on the various parameters used, see the Windows API documentation.