O.P. RE: Using C# DLL
Hi, I created a new class just like the VB sample code.
using System;
using System.Runtime.InteropServices;
namespace MyDLL
{
[ComVisible(true)]
public class Operations
{
[ComVisible(true)]
public string getValue1(string sParameter)
{
switch (sParameter)
{
case "a":
return "A was chosen";
case "b":
return "B was chosen";
case "c":
return "C was chosen";
default:
return "Other";
}
}
public string getValue2()
{
return "From VBS String Function";
}
}
}
And the I try to use it from jscript.
I have tried:
Interop.Call("C:\\Program Files\\Messenger Plus! Live\\Scripts\\MySecondScript\\MyDLL.dll", "getValue1", "a");
and I received the error: Interop.Call failed to locate function "getValue1"
I have also tried: var myObj = new ActiveXObject("MyDLL.Operations"); and I receive the error: unknown (code: -2147024894)
|