Question : GUID of a ActiveX OCX

I'm trying to get the main GUID of a ActiveX OCX from just the full path of the OCX.
1. It may not be registered so I can't get it from Registry.
2. I can't use TlbInf32.Dll because the program uses ITypeLib to eliminate dependencies.

Here is the code I am using:
http://www.jsware.net/jsware/zips/tlbread.zip
Article is here:
http://www.jsware.net/jsware/vbcode.php3#tlbc

Answer : GUID of a ActiveX OCX

LOoking at like for like:

Function IsLike(Value, Pattern)
Dim regEx
   
    Set regEx = CreateObject("vbscript.regexp")
        With regEx
            .Global = True
            .IgnoreCase = True
            .Pattern = "^" & Replace(Pattern, "*", ".{0,}") & "$"
            IsLike = .Test(Value)
        End With
    Set regEx = Nothing
End Function

Will accept control codes between the strings whereas

Function IsLike(ByVal TextVal, ByVal Pattern)
  Dim RXP
  IsLike = False
  Set RXP = New RegExp
    With RXP
      .Global = True
      .IgnoreCase = True
      .Pattern = "^" & Replace(Pattern, "*", "[\x20-\x7E]*") & "$"
      IsLike = .Test(TextVal)
    End With
  Set RXP = Nothing
End Function

WIll ensure the only characters between the components are alphanumerics and common punctuation.

Chris
Random Solutions  
 
programming4us programming4us