Results 1 to 40 of 51

Thread: Add-In: StaticToolz (Attached in First Post..just for fun)

Threaded View

  1. #8
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    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:
    1. Dim mCol As Collection
    2.  
    3. Private Sub LoadData()
    4. Dim i                   As Integer
    5. Dim j                   As Integer
    6. Dim lMember             As MemberInfo
    7. Dim lConst              As ConstantInfo
    8. Dim tliTypeLibInfo      As TypeLibInfo
    9.    
    10.     On Error Resume Next 'Some Libs hasn't data to show and TypeLibInfo fire error
    11.    
    12.         For i = 1 To mCol.Count
    13.             Set tliTypeLibInfo = TLI.TypeLibInfoFromFile(mCol.Item(i))
    14.             For Each lConst In tliTypeLibInfo.Constants
    15.                 For Each lMember In lConst.Members
    16.                     list1.AddItem lConst.Parent & " ; " & lConst.Name & " ; " & lMember.Name
    17.                 Next
    18.             Next
    19.         Next
    20.         Set tliTypeLibInfo = Nothing
    21. End Sub
    22.  
    23. Private Sub Command1_Click()
    24.     LoadData
    25. End Sub
    26.  
    27. Private Sub Form_Load()
    28.     Set mCol = New Collection
    29.    
    30.     'I'll add some files..
    31.    
    32.     mCol.Add ("MSVBVM60.DLL")   'VBA Lib
    33.     mCol.Add ("MSVBVM60.DLL\3") 'mmm..more VBA?
    34.     mCol.Add ("VBRUN.OCX")      'VBRUN Lib
    35.     mCol.Add ("comctl32.ocx")   'Common Controls
    36.     mCol.Add ("richtx32.ocx")   'Rich Textbox
    37.     mCol.Add ("msflxgrd.ocx")   'Flexgrid
    38.     mCol.Add ("comdlg32.ocx")
    39. 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
  •  



Click Here to Expand Forum to Full Width