HOOPS Publish Documentation

< Home

< Reference Manual

< File Formats

PROGRAMMING GUIDE

Contents

Programming with HOOPS Publish

Initializing and terminating a session

Handling Errors

Working with a PDF document

Inserting data on a page

Defining 3D

Populating page fields

Getting PDF nodes unique identifiers

Animation API

Initializing and terminating a session

HOOPS Publish is using two different libraries that need to be initialized separately.

A3DLIBS DLL

A3DLIBS DLL shares the code for the whole HOOPS Publish and HOOPS Exchange APIs.

Loading library and accessing functions

A3DLIBS uses explicit linking to access the functions in the API. With explicit linking, the executable using the DLL must make function calls to explicitly load and unload the DLL, and to access the DLL exported functions through a function pointer. HOOPS Publish is delivered with a unique top-level header file A3DSDKIncludes.h to help access the API. Only this header should be included in the customer application. Depending on the level of the product purchased, a specific macro should be defined before including this header:

This top-level header defines two functions to initialize and terminate a session with the A3DLIBS DLL, as well as a macro that automates the definitions of function pointers for the whole API:

In your main code segment, define INITIALIZE_A3D_API before including A3DSDKIncludes.h, then a call to A3DSDKLoadLibrary will automatically load the DLL (A3DLIBS.DLL) and call GetProcAddress on each function. At the end just call A3DSDKUnloadLibrary.

#define INITIALIZE_A3D_API
#define HOOPS_PRODUCT_PUBLISH
#include "A3DSDKIncludes.h"
if (!A3DSDKLoadLibrary(_T("")))
{
printf("Cannot load library\n");
exit(-1);
}

Initializing the A3DLIBS DLL

A3DInt32 iMajorVersion = 0, iMinorVersion = 0;
A3DInt32 iRet;
iRet = A3DDllGetVersion(&iMajorVersion, &iMinorVersion);
if(iRet == A3D_SUCCESS) { ... };
iRet = A3DDllInitialize(A3D_DLL_MAJORVERSION, A3D_DLL_MINORVERSION);
if(iRet == A3D_SUCCESS) { ... };

Terminating the A3DLIBS DLL

Terminate the A3DLIBS DLL by invoking the A3DDllTerminate function, as follows:

iRet = A3DDllTerminate();