从 Silverlight 4 调用 Communicator.UIAutomation
我正在尝试从浏览器外 Silverlight 4 应用程序实例化到 Communicator 2007 的 COM 连接。我正在跟踪一些示例代码 - 其中一个(略有不同)示例是 此处 - 但当我运行以下行时出现错误:
dynamic communicator = AutomationFactory.CreateObject("Communicator.UIAutomation");
错误是:
Failed to create an object instance for the specified ProgID.
我已经下载并安装了我认为是的 正确的 SDK,但 OLEView 不是显示 DLL 已注册 - 我需要做些什么才能在 SDK 中注册 DLL 吗? regsvr32 似乎不起作用。
我这一切都错了吗?是否有更好的选择,也许使用统一通信客户端(1.0 或 2.0)SDK?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当时 Communicator 是否正在运行?它必须正在运行才能使用 API。
当通信器运行时,上面的代码对我来说工作得很好,但是我可以通过确保当上面的行被击中时它不运行来复制您的错误。
我很确定 SDK 已注册正常,因为如果没有注册,您会收到略有不同的错误:
关于正确的 SDK - 这取决于您想要实现的目标。自动化 API(即您正在使用的 API)将允许您自动运行 Communicator 实例,因此它非常适合通过 Communicator UI 获取状态信息、启动 IM 对话、拨打电话等。仅当不能保证 Communicator 运行,或者您需要提供自己的 UI 时,您才需要查看 UCCA。
我在此处发表了有关各种 API 的博客,
还有一件事需要记住,如果可以选择升级到 Lync,那么 SDK 内置了一大堆非常有用的 Silverlight/WPF 控件 - 一些信息 此处
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:
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