I've created Class library project with next code and settings:
using System.Runtime.InteropServices;
namespace MyDll
{
[ComVisible(true)]
public class TestClass
{
[ComVisible(true)]
public string[] SomeFunc(string path)
{
return new[] {"1","7","9"};
}
}
}
Also checked
'Make Assembly COM-Visible' in Properties/Application/Assembly information
and
'Register for COM interop' in Properties/Build
In my VBscript I am getting exception
"0x800a01ad - Microsoft VBScript runtime error: ActiveX component can't create object: 'MyDll.TestClass'"
when trying to create object from dll:
Dim result
Dim myObj
Set myObj = CreateObject("MyDll.TestClass")
Set result= myObj.SomeFunc("a")
regsvr32.exe
(the advice applies to both server-side and client-side VBScript)? – user692942regasm.exe
is doing the job ofregsvr32.exe
or even calling it itself, which one is getting called? (see that link for breakdown of 32-bit and 64-bit registry locations and how using the wrongregsvr32.exe
can affect where it ends up). – user692942