1

I'm trying to instantiate a COM connection to Communicator 2007 from an Out of Browser Silverlight 4 app. I'm following some sample code - one (slightly different) example of which is here - but I'm getting an error when I run the following line:

dynamic communicator = AutomationFactory.CreateObject("Communicator.UIAutomation");

The error is:

Failed to create an object instance for the specified ProgID.

I've downloaded and installed what I believe is the right SDK, but OLEView isn't showing the DLL's as registered - is there something I need to do to register the DLL's in the SDK? regsvr32 doesn't seem to work.

Am I going about this all wrong? Is there a better option, perhaps with the Unified Communications Client (1.0 or 2.0) SDK?

Community
  • 1
  • 1
Matt McMinn
  • 15,983
  • 17
  • 62
  • 77

1 Answers1

2

Is Communicator running at the time? It must be running in order to use the API.

The above code works fine for me, when communicator is running, but I can replicate your error by ensuring that it isn't running when the above line gets hit.

I'm pretty sure the SDK is registered OK, as you'g get a slightly different error if it wasn't:

No object was found registered for specified ProgID.

With regards to the right SDK - it depends on what you're trying to achieve. The automation API (i.e. the one you're using) will allow you to automate the running instance of Communicator, so its great for e.g. obtaining presence info, starting IM conversations, placing phone calls etc uning the Communicator UI. You should only need to look at UCCA if its not guaranteed that Communicator will be running, or if you need to e.g. provide your own UI.

I blogged about the various APIs here

One more thing to bear in mind, if upgrading to Lync is an option, then the SDK has a whole bunch of really useful Silverlight/WPF controls built in - some info here

Paul Nearney
  • 6,965
  • 2
  • 30
  • 37
  • Communicator was running while my application ran, but on a hunch, I shut down communicator and restarted it, and for some reason it worked. I can't really explain why - I had restarted the system, and still saw the error, so I wouldn't have expected a restart of communicator to solve it. Nice blog entry - we have actually already looked at Lync, but it had a few issues (no out of browser support was the killer) with our project, so we need to go with 2007. Thanks! – Matt McMinn Nov 24 '10 at 14:25
  • Cool - glad it's working! Out of interest, what do you mean by "Lync has no out of browser support"? – Paul Nearney Nov 24 '10 at 15:17
  • I meant that the silverlight controls that come with Lync don't run out of browser. We've confirmed with MS that this isn't supported by the current version of Lync - which is a bummer, because those controls are pretty nice. – Matt McMinn Dec 01 '10 at 15:08
  • Not only the Lync controls, but everything in the Lync API also won't work in Silverlight out of browser. – George Durzi Dec 01 '10 at 20:27