Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to identify classes that implement an interface?

I have a VB6 EXE project with a large amount of classes - everything compiles to an EXE, there are not COM DLLs built.

Some of the classes implement the IDataProcessing interface. How can I programmatically determine the classes that implement that interface?

like image 317
AngryHacker Avatar asked Nov 20 '25 18:11

AngryHacker


2 Answers

You could use TypeOf SomeClass Is IDataProcessing if you have access to both classes or interfaces.

Or are you just wanting to iterate through all classes and check which implement that interface? There is no way to do that with classes in an EXE that I'm aware of.

like image 113
Kelly Ethridge Avatar answered Nov 23 '25 07:11

Kelly Ethridge


From MSDN:

Reflection

In Visual Basic 6.0, reflection is not supported.

In Visual Basic 2005, the classes in the .NET Framework class library System.Reflection namespace can be used to obtain information about types such as classes, interfaces, and value types at run time and to create type instances to invoke and access them.

For more information, see Reflection Namespaces in Visual Studio.

You can take a look here anyways:

Reflection Class in VB6

like image 20
Leniel Maccaferri Avatar answered Nov 23 '25 06:11

Leniel Maccaferri



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!