Retrieves one of the interfaces documented in this API reference. Use either one of the Macros (recommended) or this function to gain access to the rest of the API.
GetInterface( IPROCESSEXTREQ_HANDLE i_hIRequest, INTERFACE_ID i_id, void** o_pIRequest)
The handle you received in IProcessRequest. See hIRequest Variable.
The ID of the interface that you are requesting. This ID is defined in the header file.
This gives you back the interface you requested. You must first create a pointer to the type of interface that you want. After you call this function, this pointer will point to the actual interface that you requested.
Each function returns a RET_VALUE that is an error code of type Long. The return value is greater than zero if the call was successful, and zero or less if not. Use RET_OK(x) and RET_ERROR(x) to check for failure.
To get an interface, you can use one of the Macros. This is the easiest way to retrieve an interface. For example, the following piece of code retrieves the UserInfo interface using the GET_USERINFO_INTERFACE macro.
IUserInfo* pUserInfoInterface = NULL;
GET_USERINFO_INTERFACE(i_reqHandle, pUserInfoInterface)
unsigned short userNameSize=2;
Char* userName = new Char[userNameSize];
ret = pUserInfoInterface->GetUserName(pUserInfoInterface->hIUserInfo, &userNameSize, userName) ;
You can also retrieve the UserInfo interface using the GetInterface function:
IUserInfo* pUserInfoInterface = NULL;
i_reqHandle->GetInterface(i_reqHandle, pUserInfoInterface);
unsigned short userNameSize=2;
Char* userName = new Char[userNameSize];
ret = pUserInfoInterface->GetUserName(pUserInfoInterface->hIUserInfo, &userNameSize, userName) ;
Crystal Decisions, Inc. http://www.crystaldecisions.com Support services: http://support.crystaldecisions.com |