Including API Files in Your Program

To use the Essbase API in your program, you must include the file that contains API definitions. This topic describes the files you need for the C or Visual Basic API.

Header Files

If your program is using the Main API, essapi.h should be included. If it is using the Outline API, essotl.h should be included. If it is using the Grid API, essgapi.h should be included.

API Files for C Programs

To use the Main API in a C program, you must include the API header definitions file (ESSAPI.H) in the appropriate source modules. Always include this file after any C run-time library header files. If you are programming in the Windows environment, place ESSAPI.H after the Windows include file WINDOWS.H.

C Compiler Options (32–Bit Windows Only)

If you are using an encapsulated C development environment, such as Microsoft Visual C++, you should check the compiler and linker options carefully to ensure that the API will work correctly. In particular, you must ensure that structure fields are byte-aligned, and that the correct libraries are used. Make sure to include the appropriate API library in your link process (see API Libraries).

The following program statements will ensure byte alignment and should be placed in the INCLUDE section of the program:

#ifdef WINNT
#pragma pack (1)
#endif
#include 
#include 
#pragma pack ()
#endif

API Files for Visual Basic Program (Windows Only)

To use the API in a Visual Basic program, you must include the ESB32.BAS file for 32-bit programs. This file contains the constant definitions and declarations for all Essbase functions. You can use the file as shipped, or customize it to meet the needs of your application.

  To use ESB32.BAS:

  1. Open a project.

  2. Choose File , then Add File, and specify %ESSBASEPATH%\API\INCLUDE\ESB32.BAS.