Microsoft Visual C++

Integration

The SeaMAX Application Programming Interface can be used directly in a native Visual C++ project. The project must be configured properly to access the API definitions and link to the API implementation during the the build process.

Project Properties

The Visual C++ project properties must be updated to find and use SeaMAX API install path ("Program Files\Sealevel Systems\SeaMAX\" or "Program Files (x86)\Sealevel Systems\SeaMAX\"). This can be accomplished by the following:

  1. Choose 'Project->Properties' from the menu bar in Visual Studio
    visual_c_1.png
    Figure 1: Visual Studio Project Properties
  2. Select the 'VC++ Directories' heading
    visual_c_2.png
    Figure 2: Visual Studio Directories
  3. Select the 'Include Directories' row
  4. Click the drop-down button, and select the 'Edit...' option; a new dialog will appear
    visual_c_3.png
    Figure 3: Updating the project Include Path
  5. Click the new folder button to create a new line
  6. Click the ellipsis '...' on the new line, and navigate to the SeaMAX installation include path ('Library\Include')
  7. Click 'OK' to finish adding the include directory
  8. Select the 'Library Directories' row
  9. Click the drop-down button, and select the 'Edit...' option; a new dialog will appear
    visual_c_4.png
    Figure 4: Updating the project Library Directories path
  10. Click the new folder button to create a new line
  11. Click the ellipsis '...' on the new line, and navigate to the SeaMAX installation library path
    ('Library\32-bit' or 'Library\64-bit' depending on the target platform)
  12. Click 'OK' to finish adding the library directory
  13. Select the 'Linker->Input' heading
    visual_c_5.png
    Figure 5: Visual Studio Linker Input
  14. Select the 'Additional Dependencies' row
  15. Click the drop-down button, and select the 'Edit...' option; a new dialog will appear
    visual_c_6.png
    Figure 6: Updating the Additional Dependencies
  16. Type 'seamax.lib' on a new line
  17. Click 'OK' to finish adding the library
  18. Select the 'Build Events->Post-Build Event' heading
    visual_c_7.png
    Figure 7: Visual Studio Post-Build Events
  19. Select the 'Command Line' row
  20. Click the drop-down button, and select the 'Edit...' option; a new dialog will appear
    visual_c_8.png
    Figure 8: Updating the Post-Build Events Command Line
  21. Type copy "[SeamaxLibDir]\seamax.dll" "$(TargetDir)", where [SeamaxLibDir] is the SeaMAX library installation library path ('Library\32-bit' or 'Library\64-bit' depending on the target platform)
  22. Optionally, type a description in the 'Description' row
  23. Click 'OK' to finish adding the event
  24. Click 'Apply' to save the new properties
Note
The proceeding properties will need to be replicated for every configuration and platform combination that is desired.

API Function Definitions

Add the following include pre-processor definition to the beginning of the application source code:

#include <SeaMAX.h>

Example

The following is an example of how to call SM_Open() and SM_Close() within a Visual C++ project:

SM_HANDLE seamax;
if (SM_Open(&seamax, "COM1") < 0)
{
  // Error opening COM1
}

SM_Close(seamax);
 
 
Generated on Mon Oct 3 2022.