GUID - Reading the GUID of a file 
Author Message
 GUID - Reading the GUID of a file

I am trying to figure out how to get the GUID of a dll.  I do not want to
query the registry.  All I want to do is point to the file and then retrieve
the GUID that way.  Any help would be greatly appreciated.  Thanks.

Paul Gorman ><>



Sat, 15 Jan 2005 05:33:12 GMT  
 GUID - Reading the GUID of a file
Early bind to a DLL called TLBINF32.DLL in the system 32 folder, then use
this piece of code...

Private Function GetGUIDFromDLL(ByRef strPath As String) As String

    Dim objTLI As TLI.TLIApplication
    Dim objTLB As TypeLibInfo

    ' init
    Set objTLI = New TLI.TLIApplication

    ' get type-lib from filename -- will throw an error if file does not
have TLB
    Set objTLB = objTLI.TypeLibInfoFromFile(strPath)
    GetGUIDFromDLL = objTLB.GUID

    ' thanks, bye
    Set objTLB = Nothing
    Set objTLI = Nothing

End Function

HTH

Tim


Quote:
> I am trying to figure out how to get the GUID of a dll.  I do not want to
> query the registry.  All I want to do is point to the file and then
retrieve
> the GUID that way.  Any help would be greatly appreciated.  Thanks.

> Paul Gorman ><>



Sat, 15 Jan 2005 16:14:42 GMT  
 GUID - Reading the GUID of a file
Thanks.  Works great!!! :-)

Quote:
> Early bind to a DLL called TLBINF32.DLL in the system 32 folder, then use
> this piece of code...

> Private Function GetGUIDFromDLL(ByRef strPath As String) As String

>     Dim objTLI As TLI.TLIApplication
>     Dim objTLB As TypeLibInfo

>     ' init
>     Set objTLI = New TLI.TLIApplication

>     ' get type-lib from filename -- will throw an error if file does not
> have TLB
>     Set objTLB = objTLI.TypeLibInfoFromFile(strPath)
>     GetGUIDFromDLL = objTLB.GUID

>     ' thanks, bye
>     Set objTLB = Nothing
>     Set objTLI = Nothing

> End Function

> HTH

> Tim



> > I am trying to figure out how to get the GUID of a dll.  I do not want
to
> > query the registry.  All I want to do is point to the file and then
> retrieve
> > the GUID that way.  Any help would be greatly appreciated.  Thanks.

> > Paul Gorman ><>



Sat, 15 Jan 2005 23:02:13 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. sorry but again: GUID and AUTONUMBER (not GUID only, not AUTONUMBER only, but both)

2. To GUID or not to GUID...

3. How to convert a GUID string to a GUID data type

4. Using a GUID as a Primary Key or indexing a GUID

5. AddNew with a GUID - can't get back the GUID

6. Read GUID/LCID from File...

7. GUID deconstruction to read the creation time of a record

8. Read GUID

9. Read GUID from DLL or OCX

10. Reading a GUID from an ocx.

11. File's GUID

12. GUID from File

 

 
Powered by phpBB® Forum Software