Open_HM_ExtAPI()

Opens HyperMesh session and returns pointer to API object.

Syntax

HM_ExtAPI* Open_HM_ExtAPI(
int* err_code,
int nargs,
void**  args
);

Type

HyperMesh Ext API

Description

The function Open_HM_ExtAPI() must be called prior to using HyperMesh API. The function locates existing HyperMesh installation and loads HyperMesh DLL that provides API functionality that can be accessed by using the pointer to API object returned from the call to the Open_HM_ExtAPI() function. To terminate HyperMesh session and optionally unload HyperMesh DLL call the function Close_HM_ExtAPI().

If the function succeeds, the pointer to the API object instantiated in HyperMesh DLL is returned.

If the function fails, the return value is NULL. Check the value returned in the variable pointed by err_code to get more information about the error.

In case the second call to the function Open_HM_ExtAPI() is made without prior call to Close_HM_ExtAPI() function the return value is the same pointer to the API object that was returned during the first call. However, in this case ERR_XAPI_ALREADYOPEN is set in err_code variable as the error value.

Requires including hm_extapi.h, hm_extapi.dll and hm_extapi.lib.

Inputs

err_code
[in] - Pointer to integer variable. If not NULL then when function returns the variable will contain error status value, which can have following values.
ERR_XAPI_SUCCESS - Successful completion. The function returns the pointer to API object.
ERR_XAPI_NOTFOUND - HyperMesh DLL was not found. HyperMesh is not installed, or possible installation problem.
ERR_XAPI_LOADFAIL - HyperMesh DLL was found but could not be loaded. Possible installation problem.
ERR_XAPI_OLDER_DLL - Older version of HyperMesh DLL, incompatible with current API.
ERR_XAPI_NEWER_DLL - Newer version of HyperMesh not backward compatible with current API.
ERR_XAPI_LICENSE - Problem with HyperMesh license server.
ERR_XAPI_INITFAIL - Unidentified initialization problem.
ERR_XAPI_ALREADYOPEN - The successful call to Open_HM_ExtAPI function was already made before, and this the second time the call was made without prior call to the Close_HM_ExtAPI function.
nargs
[in] - Number of additional arguments. Currently not used. Set to zero.
args
[in] - Additional arguments. Currently not used. Set to NULL.

Errors

None.