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")