none
How to view a Type Library File Conents RRS feed

  • Question

  • I realize this is not the optimal place to ask this question, but I don't know where a better place would be.

    I have a Word template Add-in that references a type library file EncodeFSB.tlb

    I am interested in just what this file is and how it works.  I have Visual Studio (2010) but other than opening the program and then opening the file EncodeFSB.tlb, I have no idea what to do next of if Visual Studio can do what I am hoping to do.

    When the file EncodeFSB.tlb opens, Visual Studio lists it in the Object Browser.  I can click on it and expand it and see that it has a class called "Encode", and the class contains two properties, and a method.  How do I access the class itself (the code) to see what it actually doing?

    Thanks


    Greg Maxey Please visit my website at: http://gregmaxey.mvps.org/word_tips.htm

    Friday, June 13, 2014 7:02 PM

Answers

  • Neither .tlb or the .dll don't contain any metada (like .Net based assemblies) which you may read after. As a rule, COM libraries are unmanaged assemblies and contain the low level machine code/instructions.
    Saturday, June 14, 2014 6:22 PM
  • Hi Greg

    Mmm, yes, and why would the owner of the library want to expose his code to the world :-)? That's one big "problem" with the .NET Framwork - the code is "exposed". Many developers use obfuscation for this reason, so no one can see how their code works. Or they don't develop using .NET and use a COM technology, instead.


    Cindy Meister, VSTO/Word MVP, my blog

    Saturday, June 14, 2014 6:33 PM
    Moderator

All replies

  • Hello Greg,

    A type library doesn't contain real definitions (code). It just describes classes, their methods and properties. Interop files is the analogy in the .Net world. The COM, DCOM, and Type Libraries page in MSDN contains the following description:

    A type library (.tlb) is a binary file that stores information about a COM or DCOM object's properties and methods in a form that is accessible to other applications at runtime. Using a type library, an application or browser can determine which interfaces an object supports, and invoke an object's interface methods.

    Friday, June 13, 2014 7:45 PM
  • Eugene,

    Thanks.  It is all a bit over my head so I understand if you loss interest.

    So somewhere on my PC is a file that contains a class called "Encoder" described by the EncoderFSB.tbl file.  How to I access that file and view the class?  If it is possible, I want to see what it is and try to understand how it works.

    Thanks.


    Greg Maxey Please visit my website at: http://gregmaxey.mvps.org/word_tips.htm

    Friday, June 13, 2014 7:53 PM
  • The COM technology is a windows registry based. There you can find a file path to actual file which contains the class described by the .tlb file.

    I'd recommend reading what the COM technology is first. See Component Object Model .

    Friday, June 13, 2014 8:18 PM
  • Eugene,

    No joy.  I suppose if I read a Medical Journal, some who come to expect I could practice medicine.  That article was like an introduction to Greek.  No offense.  It offered no insight, to me at least, into how I could find, access and then read the class module Encode.

    Thanks for you interest and reply just the same.


    Greg Maxey Please visit my website at: http://gregmaxey.mvps.org/word_tips.htm


    • Edited by Greg Maxey Saturday, June 14, 2014 1:53 AM
    Saturday, June 14, 2014 1:52 AM
  • Hi Greg

    Theoretically, if you set a Reference to the *.tlb in the VBA Editor you should be able to view its contents in the Object Browser (F2), same as for any Office tlb...


    Cindy Meister, VSTO/Word MVP, my blog

    Saturday, June 14, 2014 5:39 PM
    Moderator
  • Cindy,

    Yes, I can see it is a class with a  method "Encode" and two string properities, but I can't see the code in the class.


    Greg Maxey Please visit my website at: http://gregmaxey.mvps.org/word_tips.htm

    Saturday, June 14, 2014 5:59 PM
  • Neither .tlb or the .dll don't contain any metada (like .Net based assemblies) which you may read after. As a rule, COM libraries are unmanaged assemblies and contain the low level machine code/instructions.
    Saturday, June 14, 2014 6:22 PM
  • There is no easy or straight way to see the source code due to the fact that COM servers are unmanaged assemblies and contain low-level machine instructions.
    Saturday, June 14, 2014 6:23 PM
  • Hi Greg

    Mmm, yes, and why would the owner of the library want to expose his code to the world :-)? That's one big "problem" with the .NET Framwork - the code is "exposed". Many developers use obfuscation for this reason, so no one can see how their code works. Or they don't develop using .NET and use a COM technology, instead.


    Cindy Meister, VSTO/Word MVP, my blog

    Saturday, June 14, 2014 6:33 PM
    Moderator
  • Cindy,

    You are probably correct in assuming that they don't.  Based on some other reading I've done, since the code (whatever it may be) is not going to be VBA, I probably wouldn't understand it anyway.

    Thanks.


    Greg Maxey Please visit my website at: http://gregmaxey.mvps.org/word_tips.htm

    Saturday, June 14, 2014 6:41 PM