Accessing a .Net COM dll in javascript
Copy link to clipboard
Copied
Hey Guys,
I'm having an issue trying to get access to local .Net Class Library I made in C#. and the methods within it. I have created it as COM visible and would like to use javascript to call it.
I'm not that familiar with javascript so I've searched around and have hit a roadblock, its that this is not going to be running through a web browser.
So..:
var ObjFromDll = new ActiveXObject("mydll");
is not available
I eventually have plans to tie this Class Library into the Photoshop UI as I have done with other softwares.
Example C#/.Net
using System;
using System.Runtime.InteropServices;
namespace myDotNetLibrary
{
[ComVisible(true)]
[ClassInterface(ClassInterfaceType.None)]
[System.Runtime.InteropServices.ProgId("myDotNetLibrary.DLL")]
[System.Runtime.InteropServices.Guid("ccb48297-eac2-4c14-a37a-9acb653d82c2")]
public interface ISVNLibrary
{
bool IsFileConflicted(string MyFilePath);
}
public class myLib : IMyLibrary
{
[ComVisible(true)]
public bool IsFileConflicted(string MyFilePath)
{
bool fileConflict = false;
return fileConflict;
}
}
}
Any advice would be appreciated.
Explore related tutorials & articles
Copy link to clipboard
Copied
You would have to read the JavaScript Tools Guide, chapter 7 Integating External Libraries
There is also an example in the Bridge SDK
The Tools guide should be accesed via the help menu of ExtendScript Toolkit
and the Bridge SDK is available from http://www.adobe.com/devnet/bridge.html
This is all above me and I would be very interested if you get it to work with c#
Copy link to clipboard
Copied
Ok, so I followed up with that extendscript "Intergrating External Libraries" and it seems to be what I am looking for, or at least close enough to work off of. It does look like I have to write it in C++ or C, C# doesnt seem supported. I'll have to dig around a bit more. Thanks for the tip.

