views:

162

answers:

3

If I make use of a Type Library in a VB6 project do I need to distribute the .tlb file (and perhaps even register it?) with the compiled exe on the target computer?

+1  A: 

No you don't. It's only used at compile time.

GSerg
A: 

Only if you are using multi-threading, i.e. ActiveX EXEs or in-proc with CoMarshalInterThreadInterfaceInStream etc. functions.

wqw
+1  A: 

No, usually it is only needed if you actually call code that attempts to use the types from the type library. I have found some exceptions, involving using types from the type library to dimension variables. I think it was something like this...

Supposing the type library defines a structure A, and your app contains a procedure like this. If the type library is not registered your app cannot start - an error message is displayed.

Sub testSub1(ByRef mybadarray() As A)

but this would be OK

Sub testSub2()
  Dim ok As A ' OK provided you never actually Call testSub2 at runtime '
MarkJ