Results 1 to 8 of 8

Thread: Help on Type Libraries versus dll

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 1999
    Posts
    161

    Help on Type Libraries versus dll

    Could anyone help me figure out what the difference between a type library and a dll is ?

    I have a large project on my lap that uses a tlb file with several enums, and several components that use these enums.

    I tried to make a modification to one of the enums, and now I can't get my project to run anymore.....

    Thanks !

  2. #2
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539
    Type Libraries are c++ thing
    dll are everything thing

    and dlls are usually faster than type libraries as well they can be used on different applications such as vb, access,
    where type libraries are only c++

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 1999
    Posts
    161
    I am sure you have your sources... but this project is only VB. I am still not sure why the developper chose a type library, but I know this is being used in VB.....


  4. #4
    jim mcnamara
    Guest
    A type library (.tlb) describes both methods & properties as well as interfaces for a COM object. That is all it does. Describe.

    It's an actual language, odl, that you compile to make a type libray file. The C++ version of the compiler is idl (or MIDL). VB has one, too. it's called MKTYPLIB.

    A type library is what VB Object Browser uses to show properties & methods. A type library can be embedded in a dll or an ocx file.
    When you create a VB ActiveX COM object this what happens.
    VB buries the type library in the file.

    A type library can be standalone. A standalone tlb file can't really do anything except describe. It has no functions. All it does is describe things to other interested programs. It doesn't have any code to support the methods or properties it describes.

    hth

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    May 1999
    Posts
    161
    Thanks jim... that helps a lot...

    Now, onto my problem... I re-compiled the project that creates that type library (and dll). I was told I was supposed to un-register the dll to be able to use the tlb... that will not work. I don't even get error messages. The application just won't start.

    If I don't un-register the dll, I can run the project, but if I look in the references, the dll is referenced in the project, not the tlb anymore...

    Does that make sense ? What should I do to get my project running the way it was before ?


  6. #6
    jim mcnamara
    Guest
    Okay - I'm confused.

    It sounds like you had some kind of COM dll file with a separate tlb file. Then you took the VB project it was made from, recompiled it, or did something like unregister the server - but now, what isn't the same? Specifically, what is broken?

    About all you may 'break' is the fact that the external tlb file no longer has anything to do with what VB sees in terms of methods & properties. That it?

  7. #7
    jim mcnamara
    Guest
    Oops my bad. I finally read the first post and understand.

    Put those same enums (cut & paste) into the interface definition part of the cls module. That will become part of the embedded type library in the compiled dll. So your enums will work again.

    That it? I hope.

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    May 1999
    Posts
    161

    Unhappy

    It already is... I think...

    The project is OTDREnums.vbp; it contains one class only: clsEnums.cls that looks basically like this:

    PHP Code:
    Option Explicit

    Public Enum eMainDbStatus
      NoConnection 
    0
      OffLine 
    1
      OnLine 
    2
    End Enum

    ' Many more Enums here...

    Private Sub callthis()

    End Sub

    Private Sub Class_Initialize()
    callthis
    End Sub 
    Thanks for your help !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width