redoctober
Programmer
Hi,
i'm planing to write a class library in C# and then use it in VB6 aplication. So i wrote a little test program. Here's the C# just in case:
using System;
namespace MyClassLibrary
{
public interface MyStab
{
void Init();
string Append(string s);
}
public class MyClass : MyStab
{
private string mText;
public MyClass()
{
}
public void Init()
{
mText = "hello world";
}
public string Append(string s)
{
return s + mText;
}
}
}
I compile the dll and register it then add the reference in my VB6 aplication. The Intellisense in VB sees the class and methods exposed by the interface of C# so i wrote this little program to test its functionality:
Dim test As MyClassLibrary.MyStab
test = New MyClassLibrary.MyClass
Dim name As String
Dim outname As String
test.Init
name = "testing"
outname = test.Append(name)
However when i run this code i get the Run-time error '91' in the second line when i try to instantiate the class. I don't know VB very well so i wanted to ask if anyone sees what i'm doing wrong here or maybe not doing something i should?
I appreciate any help.
i'm planing to write a class library in C# and then use it in VB6 aplication. So i wrote a little test program. Here's the C# just in case:
using System;
namespace MyClassLibrary
{
public interface MyStab
{
void Init();
string Append(string s);
}
public class MyClass : MyStab
{
private string mText;
public MyClass()
{
}
public void Init()
{
mText = "hello world";
}
public string Append(string s)
{
return s + mText;
}
}
}
I compile the dll and register it then add the reference in my VB6 aplication. The Intellisense in VB sees the class and methods exposed by the interface of C# so i wrote this little program to test its functionality:
Dim test As MyClassLibrary.MyStab
test = New MyClassLibrary.MyClass
Dim name As String
Dim outname As String
test.Init
name = "testing"
outname = test.Append(name)
However when i run this code i get the Run-time error '91' in the second line when i try to instantiate the class. I don't know VB very well so i wanted to ask if anyone sees what i'm doing wrong here or maybe not doing something i should?
I appreciate any help.