|
-
Oct 26th, 2001, 08:41 AM
#1
Thread Starter
Addicted Member
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 !
-
Oct 26th, 2001, 08:46 AM
#2
Frenzied Member
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++
-
Oct 26th, 2001, 08:50 AM
#3
Thread Starter
Addicted Member
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.....
-
Oct 26th, 2001, 09:06 AM
#4
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
-
Oct 26th, 2001, 09:53 AM
#5
Thread Starter
Addicted Member
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 ?
-
Oct 26th, 2001, 03:12 PM
#6
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?
-
Oct 26th, 2001, 03:16 PM
#7
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.
-
Oct 29th, 2001, 07:55 AM
#8
Thread Starter
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|