Results 1 to 31 of 31

Thread: How do I create a TypeLib for UDTs in VB6?

Hybrid View

  1. #1
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,454

    Re: How do I create a TypeLib for UDTs in VB6?

    I'm not sure, whether all participants in this thread are aware, that the acknowledged rule:
    "You don't have to ship a *.tlb along with your compiled Binaries" only holds true for typelib-infos,
    which are *not* related to UDT-definitions in said *.tlb.
    If a given *.tlb does contain UDT-defs - and when these UDTs in turn are used either:
    . 1) in Variants (forcing IRecordInfo to kick in)
    . 2) as Arguments in Event-Definitions (same reason as above)
    . 3) as Arguments in Method-Signatures on Public COM-Interfaces
    ...then the vbRuntime will be forced to perform extra-registry-lookups at runtime
    (no matter if the tlb-info was known at compile-time)...

    And whilst #3 above is only relevant for ActiveX-Exes, Dlls or OCX-Binaries -
    the points #1 and #2 are relevant also for normal "Standalone-Exes"...

    That means, that a created TypeLib (which defines a "Variant-capable UDT"),
    *has* to be shipped along with the Executable in question and it needs registering as well -
    (when points #1 and #2 above are true).

    So, this means that "bothering with *.tlb-creation the hard way" is not really necessary, because
    it's easier and much more straight forward, to define the "Public, and Variant-capable UDT-Def"
    inside an ActiveX-Dll project (which can then also contain other useful Helper-Classes) -
    and then simply use SxS-manifests, to be able to ship the Standard-Executable (along with the
    compiled ActiveX-Dll) as a portable App.

    Olaf
    Last edited by Schmidt; Aug 21st, 2016 at 06:21 PM.

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