Advertise here: Contact FM.


How do I get the names of an ActiveX control's members?
July 20, 2006 1:20 PM   RSS feed for this thread Subscribe

I have to write a Visual Basic 6 program that checks that an ActiveX control's properties and methods are correctly documented in a Word document. How do I get a list of a control's properties and methods, given its filename?

Given the filename 'MyControl.ocx', for example, how would I obtain an array of its properties and methods?

I have OLE Viewer, a Microsoft utility that can generate IDL information for an ActiveX control. This contains, amongst other junk, all the control's properties and methods. Running 'oleview.exe "C:/path/to/MyControl.ocx"' generates the IDL in a window - is there a way of saving this IDL stuff to a file using a command-line option that I could call from VB? If so, I could open up the saved IDL file and use VB's (limited) string functions to get a list of properties and methods.

Is there, however, an easier way?

Ideally, I'd like to be able to do CreateObject("MyControlName") and then use some VB function to get a collection of the class member names. All the controls I want to check are registered on my PC.


(I'm stuck with VB6 since my work PC is ancient.)

Thanks in advance.
posted by matthewr to technology (2 comments total)
I can't remember how to start a process in VB6, but if you run 'oleview.exe "C:/path/to/MyControl.ocx" > file.txt' that will send the output of oleview to a file.

You might also check out the MemberInfo class - looks like you could do it programatically using it. Some info here
posted by sanko at 3:06 PM on July 20, 2006


Thanks, sanko. The TypeLib/TLIApplication stuff was exactly what I wanted.
posted by matthewr at 4:02 AM on July 21, 2006


« Older Help save my vacation. Boat wo...   |   Can you recommend a program on... Newer »
This thread is closed to new comments.