Newbie : Problem Inheriting from a VB dll

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi all,

I'm relatively new to this so please bare with me here.

I have a whole lot of VB dll's that I use and all of them inherit from one
central dll. Now in VB, I simply use the Inherits keyword and include the
base dll in my references for that particular project I'm working in. I also
have to state the MyBase.New(p1, p2, p3) in the New (i.e. constructor
Method) of the dll I'm working in. Incidentally, you'll notice the
constructor accepts 3 parameters. Everything works fine.

I now want to be able to inherit from the same base dll in my C# class
library project but am unsure of how to go about this. I have to pass the 3
parameters. Do I simply do something similar to the inheriting VB dll's and
use the MyBase.New in my C# contructor method?

Any help appreciated.

Regards
John.
 
Hi John,

The steps will be similar except for MyBase. In C#, the constructor will
look like this

public DerivedClass(int p1, int p2, int p3): base(p1, p2, p3)
{
// Constructor code goes here.
}
 
Worked great, thanks.

Dmitriy Lapshin said:
Hi John,

The steps will be similar except for MyBase. In C#, the constructor will
look like this

public DerivedClass(int p1, int p2, int p3): base(p1, p2, p3)
{
// Constructor code goes here.
}

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

John said:
Hi all,

I'm relatively new to this so please bare with me here.

I have a whole lot of VB dll's that I use and all of them inherit from
one central dll. Now in VB, I simply use the Inherits keyword and include
the base dll in my references for that particular project I'm working in.
I also have to state the MyBase.New(p1, p2, p3) in the New (i.e.
constructor Method) of the dll I'm working in. Incidentally, you'll
notice the constructor accepts 3 parameters. Everything works fine.

I now want to be able to inherit from the same base dll in my C# class
library project but am unsure of how to go about this. I have to pass the
3 parameters. Do I simply do something similar to the inheriting VB dll's
and use the MyBase.New in my C# contructor method?

Any help appreciated.

Regards
John.
 
Back
Top