|
|
|||||||
I'm working on a method of automatically importing constants and enums. I'm looking for a way to get from the object to the typelib, for example "word.document" -> "c:\program files\Microsoft Office\Office10\MSWORD.OLB" I just can't see how to associate the registry entries. |
||||||||
|
|
|||||||
well... .olb is not typelib, is it? |
||||||||
|
|
|||||||
that be it i think word.document\CLSID = {00020906-0000-0000-C000-000000000046} HKEY_CLASSES_ROOT\CLSID\{00020906-0000-0000-C000-000000000046}\TYPELIB = {00020905-0000-0000-C000-000000000046} HKEY_CLASSES_ROOT\TypeLib\{00020905-0000-0000-C000-000000000046}\8.2\0\win32\default = C:\Program Files\MSOffice\Office10\MSWORD.OLB -Shawn |
||||||||
|
|
|||||||
k, what that olb stands for? office library? |
||||||||
|
|
|||||||
guess so, but I don't think we've answered Richard's question ... the problem is - given any PROGID, determine the typelib, no matter what the class. Think they're are a few more steps we're missing - that 8.x keyname stuff is specific to Office, must be other routes to this value, that aren't package specific. |
||||||||
|
|
|||||||
well, I can't comment as don't have that stuff. thus, it's not specific to office but specific to office10 (xp or what the heck it was) |
||||||||
|
|
|||||||
Here's a pretty good knowledgebase: INFO: Registry Entries Made by an ActiveX Component But checked quickly, think this office stuff breaks the rules a little bit - not totally sure. Btw - one of the KB references is to Dale Rogerson's "Inside COM" book ... he's the MS COM guru and this is (debatably) the "COM Bible", kinda like the K&R of COM. -Shawn |
||||||||
|
|
|||||||
These are the basic steps I'm using in AdminScriptEditor to provide COM "ScriptComplete", which of course requires getting the typelib from a known progid:
Like Shawn points out, though, this procedure doesn't work in every case. The immediate exceptions that come to mind are the office exe's and several of the VBScript-specific ProgIDs. This should cover the vast majority, though. I actually contacted MS COM development team on this and they told me there's no way to guarantee the result with this method. If you're asking specifically about how to absolutely account for these exception types, to my knowledge the only way to do it is a less-than-ideal hack. In your example, however, IIRC, the result is the same path and filename except the extension is .exe. So, if the resulting file is an .exe you can check the same directory for an .olb file with the same name and if you find it query the typelib from there. Again, certainly not an ideal solution, but will get you close. IIRC, some of the Office exe and olb files were not even in the same directory, but I can't remember which apps and Office versions those were--so in those cases there's no resolution. If you find something that is a bit more concrete I would love to know about it. HTH |
||||||||
|
|
|||||||
k, looking in my typelib branch, this 8.2 stuff you talking about is nothing unusual. all typelibs give somekind of version number there. so, what is the difficulty in that? |
||||||||
|
|
|||||||
Quote: Getting the version number so that you can read the right key Sorry I haven't updated, had to be somewhere else yesterday. I thought that I'd gone through all the GUID / key combinations and hadn't got a consistantly working result. I'll work through the suggestions and let you know how I get on. |
||||||||
|
|
|||||||
well, mostly there is only one version, that makes it rare to have problems with it. k, have to dig deeper... |