Jump to content



Photo

JavaScript Calling Method From DLL


  • Please log in to reply
2 replies to this topic

#1 Joni_78

Joni_78

    Neowinian Senior

  • Joined: 19-April 04
  • Location: Finland
  • OS: Windows 8 Pro with Media Center, OS X Mavericks 10.9.4
  • Phone: Nokia Lumia 920

Posted 21 November 2012 - 07:39

If I call a method from dll like this, does the C# DLL work or does it need to be a ActiveX DLL?
var ObjFromDll = new ActiveXObject("DllRegisteredName");

var anyResult = ObjFromDll.MyMethod()



#2 Andre S.

Andre S.

    Asik

  • Tech Issues Solved: 12
  • Joined: 26-October 05

Posted 22 November 2012 - 03:48

C# can be used to create ActiveX dlls, but if it's just a "plain" .NET assembly, then you certainly can't call it like that.

#3 OP Joni_78

Joni_78

    Neowinian Senior

  • Joined: 19-April 04
  • Location: Finland
  • OS: Windows 8 Pro with Media Center, OS X Mavericks 10.9.4
  • Phone: Nokia Lumia 920

Posted 22 November 2012 - 10:22

Yay, I got it working. JavaScript HTML now access to the com dll. It has one problem though, every time I ran it, it gives a security warning on IE or WMC that ActiveX-component might not be safe. How do I mark my dll object safe in? I found some examples but none on C#.