Results 1 to 1 of 1

Thread: [Resolved] ITypeLib.GetDocumentation info/example

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2003
    Location
    Minneapolis, MN
    Posts
    151

    [Resolved] ITypeLib.GetDocumentation info/example

    [Edit]

    Persistence pays off. Couldn't find much documentation (at least in my copy of the MSDN Library), but there is a DLL that provides everything you need to retrieve TypeLib Information (TLBINF32.DLL). Add a reference to it in your project and you can do the following.

    Simplistic example:

    Private Sub Command1_Click()

    Dim oLibInfo As TypeLibInfo
    Dim oMemInfo As MemberInfo

    Set oLibInfo = TLI.TLIApplication.TypeLibInfoFromFile(<path and file name of DLL or TLB file>)
    For Each oMemInfo In oLibInfo.TypeInfos.NamedItem("ElementEnum").Members
    With oMemInfo
    Debug.Print .Value & vbTab & .HelpString
    End With
    Next

    End Sub

    Yay!!!

    [/Edit]


    Greetings and Salutations,

    [Sorry for the cross-post, was fishing in the API pond but wasn't getting any nibbles.]

    Let me start out by admitting my lack of proficiency in C++.

    It is because of this that I am posting this question.

    Background: I have created a Type Library (using ODL) that among other things, contains an enumerator of values. Each element has an associated "helpstring" entry describing the element.

    Question: Can you provide me with information and/or an example on how to use GetDocumentation() to retrieve the value of the "helpstring" for a given entry.

    Example:
    ...
    library EnumExample
    {
    typedef
    [ helpstring("Example enumerator") ]
    enum {
    [ helpstring("This is the description of Element 1") ]
    Element1 = 101,
    [ helpstring("This is the description of Element 2") ]
    Element2 = 102,
    [ helpstring("This is the description of Element 3") ]
    Element3 = 103
    } ElementEnum;
    }

    Goal (simplistic example): sDesc = GetHelpString(EnumExample.ElementEnum.Element2)

    Dilema: I have found some documentation for C++, but as I admitted up front, my proficiency is limited and am having a difficult time figuring out how to develop a solution using VB6.

    My current work around is a String Table in a Resource file but I would like to eliminate the need to re-type the descriptions, as well as free up the use of the Resource ID's for other purposes.


    Thank you for any assistance that you may provide.
    Last edited by rlwhealdon; Apr 8th, 2003 at 12:31 PM.

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