Verastream SDK for Airlines
Using Verastream SDK with Visual C++

Before Verastream SDK can be used with a Visual C++ project, you must expand the Include path to include VSDKDefs.h from the SDK include directory (one time only), and you must add the Type Library Files (.tlb) to each project that you are using with the SDK. Once completed, the Verastream SDK COM classes are accessible within that project. A simple test project is recommended to ensure full functionality before project development.

Note Micro Focus Verastream SDK for Unisys and Airlines objects require Visual C++ v. 6.0 or later. Using SDK objects in Visual C++ applications requires a fundamental knowledge of the COM architecture.

To add VSDKDefs.h to your Include path and include the Verastream SDK COM objects in Visual C++::

  1. Create a new Visual C++ MFC project or open an existing project.                       

  2. In Solution Explorer, right click on the project and select Properties.                          

  3. Under Configuration Properties, select VC++ Directories.                       

  4. Select Include Directories and add the Verastream SDK Include directory (<Installation drive>:\Program Files (x86)\Micro Focus\VerastreamSDK\include).

  5. From the Project menu, select ClassWizard.                        

  6. In the MFC ClassWizard dialog box, in the Add Class list, select to add a class from a type library.                        

  7.  Browse to the SDK include directory.                        

  8. Select SessionLoader.tlb, then select  >> to generate classes for this library and click Finish.                        

  9. Repeat steps 6-8 to import Mutable.tlb and ScreenUPG.tlb1.

  10. When you are finished, select to Apply these classes and close the class wizard.
    The selected objects appear on the Class name list.

  11. If you want to use the SendStatus, RawDataTransmitBytes, and getCapturedBytes methods, you must use the following files that are included with the MFC Events sample application (<Installation Location>\samples\MFC):
    • iscreenupg.h                                                
    • iscreenupg.cpp
      These methods are not properly imported with the Class Wizard.

Using the SDK with Microsoft Foundation Classes (MFC)

  • To create objects, you must first initialize for COM operations using CoInitialize or CoInitializeEx. (CoInitializeEx is required if you will be using events—for more information, see Handling Events).        

    Alternatively, if you use Microsoft Foundation Classes (MFC), you can use the AfxOleInit function.

  • After receiving an interface pointer from an SDK method, it is the caller's responsibility to Release() any non-zero pointer when finished with it. Checking returned pointers for NULL values before using them is also highly recommended. This is particularly important since many properties do not consider it an error condition to return a NULL interface pointer indicating that the property is "empty."        
  • After receiving a BSTR pointer from an SDK method, it is the caller's responsibility to use ::SysFreeString() or equivalent when finished, to free the string memory.        

The sample application MFC Events illustrates how to use the SDK with Visual C++.

Related Topics
Development Tools Supported
Sample Applications Overview