public bool GetOcxFileByBrowse(System.Windows.Forms.Form caller, out string sMsg)
 {
     sMsg = "";
     System.Text.StringBuilder           sb  = new System.Text.StringBuilder(200);
     System.Windows.Forms.OpenFileDialog dlg = new System.Windows.Forms.OpenFileDialog();
     dlg.Title  = "Open Type Library";
     dlg.Filter = "Type Libraries (*.tlb;*.olb;*.dll;*.ocx)|*.tlb;*.olb;*.dll;*.ocx|All Files (*.*)|*.*";
     GetSystemDirectory(sb, 200);
     dlg.InitialDirectory = sb.ToString();
     if (dlg.ShowDialog(caller) == System.Windows.Forms.DialogResult.OK)
     {
         try
         {
             TLI.TypeLibInfoClass tliTypeLibInfo = new TLI.TypeLibInfoClass();
             tliTypeLibInfo.ContainingFile = dlg.FileName;
             //
             rec         = new TypeRec();
             rec.GUID    = tliTypeLibInfo.GUID;
             rec.LCID    = tliTypeLibInfo.LCID;
             rec.MainVer = tliTypeLibInfo.MajorVersion;
             rec.MinVer  = tliTypeLibInfo.MinorVersion;
             rec.LoadInfo();
             //
             return(true);
         }
         catch (Exception er)
         {
             sMsg = er.Message;
         }
     }
     return(false);
 }
 public void LoadInfo()
 {
     try
     {
         typeInfo = new TLI.TypeLibInfoClass();
     }
     catch (Exception e)
     {
         throw new ExceptionTLI(e);
     }
     try
     {
         typeInfo.LoadRegTypeLib(GUID, MainVer, MinVer, LCID);
     }
     catch (Exception e)
     {
         throw new LoadActiveXInfoException(string.Format(CultureInfo.InvariantCulture, "Error calling TypeLibInfoClass.LoadRegTypeLib to get ActiveX information [{0}, version:{1}.{2}, LCID:{3}]", GUID, MainVer, MinVer, LCID), e);
     }
 }