Application name control PresenceEnabled is always false
I have an application WPF
with a control WebBrowser
that loads an HTML file from a local drive. In the HTML file, I have javascript code to create an Name.NameCtrl.1
Office Office Lentยฎ Presence ( ) ActiveX control object that is used to display a contact card for some users.
The object is created, but the property PresenceEnabled
for managing names is always false . Any ideas how I can get around this problem?
I have Lync 2013 installed on my computer. The same code worked great when I was using Lync 2010.
My browser is IE 9 and I observed the same problem in IE 8 and IE 10 (currently targeting IE only).
Javascript code:
try {
var presenceObj = new window.ActiveXObject("Name.NameCtrl.1");
} catch (err) { }
function showLync(element) {
try {
// Works fine till this part. However, presenceObj.PresenceEnabled is false.
presenceObj.ShowOOUI("somecalculatedalias", 0, $(element).offset().left, $(element).offset().top);
} catch (err) {
// goes into the catch block above with a "Permission denied" error (-2146828218)
}
}
More details : I added a MOTW (Webpage Label) to my HTML page to make sure it displays without warning and I can see the page is loading in the correct zone. From page properties: Local intranet | Protected Mode: Off
.
When I delete this MOTW, I get a warning as expected, saying "To protect your security, your web browser has restricted this file ... (blah blah)". And when I allow blocked content, the same code works fine and I see the Lync popup from the ShowOOUI call.
source to share
Any ideas how I can get around this problem?
Place the AllowPartiallyTrustedCallers (APTCA) attribute on the assembly.
Here are some other alternatives:
source to share