views:

71

answers:

2

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?

+1  A: 

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

Leniel Macaferi
The MSDN article denigrates VB6 a bit too much. You can do reflection on types that are publicly available through COM. Not on private types though as far as I know. http://stackoverflow.com/questions/547903/self-inspection-of-vb6-udts/550059#550059
MarkJ
+2  A: 

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.

Kelly Ethridge