I have a com dll written in vb6. I need to write c# code that wil get me a list of all the classes within it.
My Objective is to get the classes and generate the classes in .net with all the properties and create a mapping class.
I just need to get a list of classes from the dll.
Summary: How can I get a list of all the classes in my com dll?
I would suggest using
TLBINF32.dll
. It is a COM component that ships with most versions of Windows. Make sure it is registered usingregsvr32.exe
from an elevated command prompt (along with your COM dll). Reference it in your .NET app (compiled to x86) and use theTLIApplication.TypeLibInfoFromFile
method. From there you can traverse the type library of the COM component and get the classes, methods, interfaces, and properties exposed.We use this library for various utilities.