How do I get the names of an ActiveX control's members?
July 20, 2006 1:20 PM
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)
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