473,398 Members | 2,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Is it possible ti inherit form 2 dll

Hi,
I am using 2 .dlls to create a 3 dll and I would like to expose all the
methods and functions form dll1 and dll2 in my 3dll so it appears as if
the methods sre in my 3dll. Currently I have

Imports dll1
Imports dll2

Public Class Test

Inherits dll1
Inherits dll2 >> Error here "Can have multiple Ihnerits"
End Class

Is it possible?

Thanks

Sep 29 '05 #1
3 1922
..NET does not allow multiple inheritance. The only way around this is to
expose interfaces in the two dll's and access them via the 3rd.
John
"Chris" <de*****@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi,
I am using 2 .dlls to create a 3 dll and I would like to expose all the
methods and functions form dll1 and dll2 in my 3dll so it appears as if
the methods sre in my 3dll. Currently I have

Imports dll1
Imports dll2

Public Class Test

Inherits dll1
Inherits dll2 >> Error here "Can have multiple Ihnerits"
End Class

Is it possible?

Thanks

Sep 29 '05 #2

I assume you are using VB.NET. You cannot have multiple inheritance in VB.

--
Juan Romero
-----------------------------------------
The successful person has the habit of doing the things failures don't like
to do.
E.M. Gray
"Chris" wrote:
Hi,
I am using 2 .dlls to create a 3 dll and I would like to expose all the
methods and functions form dll1 and dll2 in my 3dll so it appears as if
the methods sre in my 3dll. Currently I have

Imports dll1
Imports dll2

Public Class Test

Inherits dll1
Inherits dll2 >> Error here "Can have multiple Ihnerits"
End Class

Is it possible?

Thanks

Sep 29 '05 #3
Chris wrote:
Inherits dll1
Inherits dll2 >> Error here "Can have multiple Ihnerits"


As the others told you, VB.Net does not support multiple inheritance
but you could have dll2 Inherit from Dll1 and then have dll3 inherit
from dll2:

'Dll2
Inherits Dll1
'Dll3
Inherits Dll2

It's not exactly the same and may work for you.

Another option is to design Dll3 with all the properties that you need
it to expose and then include instances of Dll1 and Dll2 inside Dll3
and forward the calls to those objects:

'Dll1
Public Sub Foo()
'Dll2
Public Sub Bar()
'Dll3
Private d1 As New Dll1
Private d2 As New Dll2

'This Foo just passes the call on the Dll1
Public Sub Foo()
d1.Foo
End Sub

'This Bar just passes the call on to Dll2
Public Sub Bar()
d2.Bar
End Sub

Sep 29 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jeff | last post by:
Greetings I am beginning a web app. I am using C# aspx forms for my web pages. Is it possible to create/use one aspx file as a base from which to derive other aspx files? I can not get this to...
2
by: Wu Qinliang | last post by:
I created a Windows form named myform1, and put some controls on it. I need another form named myform2. Because myform2 is similar to myform1, so I want myform2 to inherit from myform1, i.e: ...
3
by: Chris | last post by:
Hi, I am using 2 .dlls to create a 3 dll and I would like to expose all the methods and functions form dll1 and dll2 in my 3dll so it appears as if the methods sre in my 3dll. Currently I have ...
3
by: Stimp | last post by:
Is it possible to prevent the <input type="hidden" name="__VIEWSTATE" field from being generated in an aspx page? I'm running off Framework 1.1 The field is messing up a process that I need to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.