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";
}
}
}
Code (VBScript)
dim myObj
Dim myClass
Set myObj = CreateObject("MyDLL.Operations")
MsgBox myObj.getValue1("a")
MsgBox myObj.getValue2()