c++comc++builder-2010uccapi

Problems accessing uccapi.dll COM interface C++


I'm working on a project involving the Microsoft Unified Communications Client API; uccapi.dll. I'm also using Codegear C++Builder 2010, not Visual Studio. After registering the dll with regsvr32 and importing it as type library into C++Builder 2010, uccapi_tlb- and uccapi_ocx-files were generated. When having imported these into my new project I'm trying to follow the msdn guideline for creating a Office Communicator Client able of signing into the Office Communication server.

In this regard I have two questions:

I've so far found several ways of creating access points, such as.

TCOMIUccPlatform plat;
plat = CoUccPlatform::Create();

and

IUccPlatformPtr im;
im = CreateComObject(CLSID_UccPlatform);

and

IUccPlatform* pIUccPlatform;
hr = CoCreateInstance(CLSID_UccPlatform, 
                      NULL, 
                      CLSCTX_INPROC_SERVER, 
                      __uuidof(IUccPlatform), 
                     (void**)&pIUccPlatform);

and

IUccPlatformPtr pIPlat;
pIPlat.CreateInstance(__uuidof(IUccPlatform));

The three first seem to work well. The latter will give me an Assertion failed: intf!=0 error with 0×40000015 exception. Using any of the three top ones I can access methods and initialize the platform interface.

However when trying any of the same tactics to access any other interface, such as IUccContext, IUccUriManager or IUccUri, all of which have a clsid defined in the _tlb.h file, I either get a "class not registered" error in the first two cases, or a hresult failure in the third case. Which brings me to my next question.

Edit1 from UCCAPILib_tlb.h:

// 
// COCLASS DEFAULT INTERFACE CREATOR
// CoClass  : UccPlatform
// Interface: TCOMIUccPlatform
//
typedef TCoClassCreatorT<TCOMIUccPlatform, IUccPlatform, &CLSID_UccPlatform, &IID_IUccPlatform> CoUccPlatform;
// 
// COCLASS DEFAULT INTERFACE CREATOR
// CoClass  : UccUriManager
// Interface: TCOMIUccUriManager
// 
typedef TCoClassCreatorT<TCOMIUccUriManager, IUccUriManager, &CLSID_UccUriManager, &IID_IUccUriManager> CoUccUriManager;

Solution

  • This issue is already being discussed in detail in the Embarcadero forums.