Fovia's C++ Server API
Getting Started

The very first task involved in using the API is to open up the library:

...
// when you're ready to begin using the API...
RRESULT ret;
ILibrary *pLibrary = NULL
ret = hdrcsrvOpenLibrary(HDRCSRV_SDK_VERSION, &pLibrary);
if(ret != S_OK) {
// failed to open the library
}

As with any other DLL, you will need to link with the hdrcsrvlib.lib file as well. You may do this under the "Link" project settings tab in Visual C++.

Note
All Interfaces that you instantiate are reference counted. You must call DecRef() on them when you are done. BCOM provides a basic smart pointer class to fascilite this process (CBComPtr).

Now that you have an ILibrary pointer you're ready to begin creating objects. Just like in COM, each object has a unique identifier. In this case it's a BGIUD. Here are the unique identifiers for each of the instantiatable objects in the library:

Here is some sample code for creating a server context:

IHdrcServer *pServer;
ret = pLibrary->CreateObject(&CLSID_HdrcServer, &pServer);
// test for failure

Use this method to create any of the objects in the list.

See the included sample code for a more concrete example of getting a session up and running.