0

I have an ActiveX control implemented as a DLL; this DLL has the type library embedded as a resource. I know that the type library contains a coclass with a special name (say "FooPlugin.BarClass").

How can I extract the CLSID of this class on the command line if I have just the DLL at the name of the class whose CLSID I would like to extract?

I saw the similiar question How to Extract TypeLib from a COM exe on Command Line which made me start tinkering with the tlbimp.exe and tlbexp.exe tools - but without success so far. Maybe I need a third tool to get a textual representation of the binary type library files or something?

Community
  • 1
  • 1
Frerich Raabe
  • 90,689
  • 19
  • 115
  • 207
  • You'll have to describe failure. Use oleview.exe, File + View Typelib to look at it, copy and paste the guid. If that fails then it doesn't have a typelib embedded. – Hans Passant Sep 23 '11 at 13:09
  • You could write your own tool around the [automation interfaces](http://msdn.microsoft.com/en-us/library/ms221027%28v=vs.85%29.aspx) – Luke Sep 23 '11 at 15:40
  • @Hans Passant: Yes, using the OLE viewer, I can get the CLSID. However, I'd like to automate this process as part of our build system (I need to generate some configuration files which have to contain the CLSID of my class). – Frerich Raabe Sep 23 '11 at 20:25

1 Answers1

2
  1. You can develop an automation tool which starts from LoadTypeLib and gets you what you need
  2. You can register the DLL (or expect it to be registered) and walk through registry HKCR for the information you want, such as starting with identifying type library identifier for your file, enumerating classes referencing type library, choosing those of your interest
Roman R.
  • 68,205
  • 6
  • 94
  • 158