|
-
Dec 8th, 2005, 07:03 AM
#8
Re: Add-In: Dim ...... As ______?
The thing is, there is a DLL named TLBINF32.DLL. It lives i n "C:\WINDOWS\SYSTEM32"
It seems that the VB Object Browser uses that DLL.
This DLL gives you all, Classes, Contants, Properties...
It needs you to pass a Filename (DLL or OCX, or TLB), as far as I saw, it reads all OCX's, but not all DLL's, seems that it reads some VB DLLs.
This can also read the data if you pass the object, also reads from registry, performs search, well, it does too many things, here Ill post a little example reading from files in a collection.
ADD reference to "Typelib Information", located in: "C:\WINDOWS\SYSTEM32\TLBINF32.DLL"
Add a List (list1) and a Commandbutton (Command1)
VB Code:
Dim mCol As Collection
Private Sub LoadData()
Dim i As Integer
Dim j As Integer
Dim lMember As MemberInfo
Dim lConst As ConstantInfo
Dim tliTypeLibInfo As TypeLibInfo
On Error Resume Next 'Some Libs hasn't data to show and TypeLibInfo fire error
For i = 1 To mCol.Count
Set tliTypeLibInfo = TLI.TypeLibInfoFromFile(mCol.Item(i))
For Each lConst In tliTypeLibInfo.Constants
For Each lMember In lConst.Members
list1.AddItem lConst.Parent & " ; " & lConst.Name & " ; " & lMember.Name
Next
Next
Next
Set tliTypeLibInfo = Nothing
End Sub
Private Sub Command1_Click()
LoadData
End Sub
Private Sub Form_Load()
Set mCol = New Collection
'I'll add some files..
mCol.Add ("MSVBVM60.DLL") 'VBA Lib
mCol.Add ("MSVBVM60.DLL\3") 'mmm..more VBA?
mCol.Add ("VBRUN.OCX") 'VBRUN Lib
mCol.Add ("comctl32.ocx") 'Common Controls
mCol.Add ("richtx32.ocx") 'Rich Textbox
mCol.Add ("msflxgrd.ocx") 'Flexgrid
mCol.Add ("comdlg32.ocx")
End Sub
I think that, when you type: DIM ..... AS _____, VB IntelliSense get all the types in MSVBVM60.DLL and ALL the types inside each OCX component you are using in your APP. If you open your Project with NOTEPAD (VBP FILE) you have all that DLL's,TLB's;OCX's listed there, it looks like this:
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\WINDOWS\system32\stdole2.tlb#OLE Automation
Reference=*\G{420B2830-E718-11CF-893D-00A0C9054228}#1.0#0#..\WINDOWS\system32\scrrun.dll#Microsoft Scripting Runtime
Object={16099B99-EC14-4BBB-807E-C06552824C4D}#1.0#0; BrowserEngine2.dll
Reference=*\G{8B217740-717D-11CE-AB5B-D41203C10000}#1.0#0#..\WINDOWS\system32\TLBINF32.DLL#TypeLib Information
Object={6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0; comctl32.ocx
Object={3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0; richtx32.ocx
Object={5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0; msflxgrd.ocx
Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0; comdlg32.ocx
Object={A8F8E827-06DA-11D2-8D70-00A0C98B28E2}#1.0#0; VCMAXB.OCX
Object={23DA51FB-240D-451E-A309-D2BBDB28ED6E}#1.0#0; vbalExpBar6.ocx
There you can see: Scripting Runtime, Common Controls, Rich Textbox, flexgrid, Common Dialog... and don't know what else.
MZ TOOLS also takes many things directly from Project files.
Well, I recomend you GOGGLE this: TypeLibinfo
Some Links:
TypeLibinfo in VbAccelerator
TypeLibinfo in MSDN
TypeLibinfo in DEVX
Last edited by jcis; Jan 25th, 2006 at 01:42 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|