I have created a dll in C# (framework 3.5) and i have declared a parameterized function into that dll. I have compiled the dll successfully. After that I have created a Classic ASP page and I want to call the parameterized function from this page that generates the following error.
Microsoft VBScript runtime (0x800A01C2)
Wrong number of arguments or invalid property assignment: 'GetData'
I am Attaching the code below
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
namespace SayHello
{
[ComVisible(true)]
public class SayHello : IMyStorage
{
[ComVisible(true)]
public string GetData([In, MarshalAs(UnmanagedType.BStr)] string Name)
{
return "hello " + Name;
}
#region IMyStorage Members
[ComVisible(true)]
public void GetData(string name, out string helloName)
{
helloName = "hello " + name;
}
#endregion
}
[ComImport]
[Guid("73EB4AF8-BE9C-4b49-B3A4-24F4FF657B26")]
public interface IMyStorage
{
[DispId(1)]
void GetData([In, MarshalAs(UnmanagedType.BStr)] String name,
[Out, MarshalAs(UnmanagedType.BStr)] out String helloName);
}
}
Now I am pasting the code of asp
Dim obj
Set obj = Server.CreateObject("SayHello.SayHello")
' Set obj = Server.CreateObject("SayHello.dll")
' Set obj= obj.Load("SayHello.dll")
inputStr = "myString"
GetObj = obj.GetData(inputStr)
SET Obj = NOTHING
Response.Write (GetObj)
Please Help me.