Call an C# inherited class from VB6

Joined
Feb 17, 2012
Messages
1
Reaction score
0
Hello there,

I have found a tutorial to call a C# DLL from VB6, but my C# class uses inheritance. And then my problem comes in..

Visual Basic code to call the C# class from the DLL:
Code:
[COLOR=#0000a0]Dim[/COLOR] obj [COLOR=#0000a0]As[/COLOR] Object
[COLOR=#0000a0]Set[/COLOR] obj = New TestProject.ChildClass

The above code works when the C# class doesn't use a superclass:
Code:
[COLOR=#0000ff]using[/COLOR] System;
[COLOR=#0000ff]using[/COLOR] System.Collections.Generic;
[COLOR=#0000ff]using[/COLOR] System.Linq;
[COLOR=#0000ff]using[/COLOR] System.Text;
 
[COLOR=#0000ff]namespace[/COLOR] TestClass
{
    [COLOR=#0000ff]public class[/COLOR] [COLOR=#2b91af]SingleClass[/COLOR]
    {
    }
}

But doesn't work if I inherit a superclass:

Code:
[COLOR=#0000ff]using[/COLOR] System;
[COLOR=#0000ff]using[/COLOR] System.Collections.Generic;
[COLOR=#0000ff]using[/COLOR] System.Linq;
[COLOR=#0000ff]using[/COLOR] System.Text;
 
[COLOR=#0000ff]namespace[/COLOR] TestClass
{
    [COLOR=#0000ff]public class[/COLOR] [COLOR=#2b91af]ChildClass : ParentClass[/COLOR]    {
    }
}

Is there a solution that I can use a C# DLL that inherit from a super class in Visual Basic 6?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top