473,387 Members | 1,592 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,387 software developers and data experts.

How to determine implemented interface

I have written an interface, let's call it AddinInterface1.
At some stage I had to add more properties to the interface.
So I wrote a new interface, AddinInterface2 which inherits AddinInterface1.

My application tries to load DLLs which implement AddinInterface1. If I have a DLL which implements AddinInterface2 I have to set some additional
properties.
How can I determine in my application which interface is implemented in a DLL?

Tosch
Nov 21 '05 #1
2 1227
How can I determine in my application which interface is implemented in a DLL?


DLLs don't implement interfaces, classes do. You can use Reflection to
determine if a certain type in an assembly implements a particular
interface (with Type.IsAssignableFrom() for example). Or if you have
already instantiated the object, you can use the TypeOf .. Is
operator.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 21 '05 #2
"Tosch" <to**********@swissonline.ch> schrieb
I have written an interface, let's call it AddinInterface1.
At some stage I had to add more properties to the interface.
So I wrote a new interface, AddinInterface2 which inherits
AddinInterface1.

My application tries to load DLLs which implement AddinInterface1. If
I have a DLL which implements AddinInterface2 I have to set some
additional properties. How can I determine in my application which
interface is implemented in a DLL?

If TypeOf o is AddinInterface2 Then
'...
elseIf TypeOf o is AddinInterface1 Then
'...
end if
Armin
Nov 21 '05 #3

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

Similar topics

24
by: Steven T. Hatton | last post by:
If I understand correctly, I have no assurance that I can determine the type of a simple class instance thrown as an exception unless I explicitly catch it by name. (non-derived classes having no...
6
by: Chris Dunaway | last post by:
I have a simple interface with two methods, MethodA, and MethodB. I also have a class with implements the interface. The class provides a full implementation for MethodA but for special reasons,...
2
by: Paul Colton | last post by:
how can my code determine the exact line and column of an XmlNode if I need to generate and error for that node?
7
by: Christopher Wells | last post by:
There's something I don't understand about how the CollectionBase class is defined. I can declare: class Derived : CollectionBase { } I can instantiate this Derived class: Derived derived...
14
by: J. Jones | last post by:
Suppose the following: class MyContainer : System.Collections.CollectionBase { //... } (where CollectionBase implements IList, ICollection) How do I determine if a type (such as...
3
by: mnet123 | last post by:
I am using "Server.Transfer()" to send data to an ASP.NET page that's sole purpose is to display messages. I am using "Server.Transfer since I can set the contents of the message I want to display...
25
by: lovecreatesbeauty | last post by:
Hello experts, I write a function named palindrome to determine if a character string is palindromic, and test it with some example strings. Is it suitable to add it to a company/project library...
15
by: Gustaf | last post by:
Using VS 2005. I got an 'IpForm' class and an 'IpFormCollection' class, containing IpForm objects. To iterate through IpFrom objects with foreach, the class is implemented as such: public class...
2
by: Ashish Gupra | last post by:
Hi, Is there any method to know the interface name through which the class has been implemented? Example: Public Interface I1 Public funcation Test() as string End Interface
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.