VB.Net inheriting from C# Class

  • Thread starter Thread starter Steve W
  • Start date Start date
S

Steve W

We are integrating some of our software with another company's software.

They use C#, we use VB.Net. We need to inherit from one of their objects in
order to change one of the methods so that it uses some of our code.

Should this be possible ? If so does anyone know of any examples etc ?

TIA

Steve
 
Yeah its possible. It has to be in its own project (or if your using a dll
then it doesn't matter... basically the C# stuff is in its on dll and your
vb.net stuff is in its own dll/executable/assembly whatever you want to call
it).

It works just the same as any type of inheritance. Your not inheriting
code, just functionality.

So.. an example.

add a reference to your C# dll...we'll call it
myCSharpProjectFromAnotherCompany

Public Class myInheritedVBClass
Inherits myCSharpProjectFromAnotherCompany.ProjectClass

....

End Class

Thats about it...

-CJ
 
Steve said:
We are integrating some of our software with another company's
software.

They use C#, we use VB.Net. We need to inherit from one of their
objects in order to change one of the methods so that it uses some of
our code.

Should this be possible ? If so does anyone know of any examples etc
?

TIA

Steve

Just compile the C# class into a DLL, then reference the DLL in your VB.NET
project, then you should be able to treat the C# class as any VB.NET class.

- Pete
 
* "Steve W said:
We are integrating some of our software with another company's software.

They use C#, we use VB.Net. We need to inherit from one of their objects in
order to change one of the methods so that it uses some of our code.

Should this be possible ? If so does anyone know of any examples etc ?

\\\
Public Class Foo
Inherits ClassLibrary1.TheCSharpClass
 
Back
Top