This is a program to generate ???.tlb files with UDT information. Basically, it's just a UI for the work posted here.
Anyone who knows how to code a UDT should find this utility fairly easy to use.
Why would we need to do this? The primary reason is to place all (or some) of our UDTs into a TypeLib so that they could be placed into Variants, and/or passed into Public procedures of objects.
Once you've created your UDT TypeLib, simply reference it within the IDE through: Menu --> Project --> References, and then browse for it. Personally, I just consider these TLB files as part of the source code. Once your TLB file is referenced in your project, you can browse it with the IDE's object browser. It will appear in the object browser under the base name of the file you saved it as.
No need for MKTYPLIB nor MIDL using this approach. If you'd like (but it's not at all necessary), you can disassemble your saved TypeLibs with the OLEVIEW from Microsoft.
I do quite a bit of validity checking in this utility, but I could do more, such as making sure UDT names and item names start with a letter. But, hopefully, most of us already know those rules.
Here's a screenshot of the main form, after I've already partially started a new TypeLib:
![Name: Type.jpg
Views: 57
Size: 31.2 KB]()
And here's a screenshot of the form for adding items to a UDT:
![Name: Item.png
Views: 56
Size: 15.0 KB]()
As an FYI, if you intend to register your TypeLib (which isn't necessary), you may want to save the GUID and then re-use it if you re-generate your TypeLib. That way, you won't clutter your registry. The version numbers are also there for you to use however you like.
As a further FYI, once your project is compiled, there's no need to distribute these TypeLib files with your executable.
And again, thanks go out to The Trick for working out most of the low-level details on how to do this, and to Fafalone for putting together the oleexp.tlb which provides access to the Windows methods that do all the work.
The project is attached:
Anyone who knows how to code a UDT should find this utility fairly easy to use.
Why would we need to do this? The primary reason is to place all (or some) of our UDTs into a TypeLib so that they could be placed into Variants, and/or passed into Public procedures of objects.
Once you've created your UDT TypeLib, simply reference it within the IDE through: Menu --> Project --> References, and then browse for it. Personally, I just consider these TLB files as part of the source code. Once your TLB file is referenced in your project, you can browse it with the IDE's object browser. It will appear in the object browser under the base name of the file you saved it as.
No need for MKTYPLIB nor MIDL using this approach. If you'd like (but it's not at all necessary), you can disassemble your saved TypeLibs with the OLEVIEW from Microsoft.
I do quite a bit of validity checking in this utility, but I could do more, such as making sure UDT names and item names start with a letter. But, hopefully, most of us already know those rules.
Here's a screenshot of the main form, after I've already partially started a new TypeLib:
And here's a screenshot of the form for adding items to a UDT:
As an FYI, if you intend to register your TypeLib (which isn't necessary), you may want to save the GUID and then re-use it if you re-generate your TypeLib. That way, you won't clutter your registry. The version numbers are also there for you to use however you like.
As a further FYI, once your project is compiled, there's no need to distribute these TypeLib files with your executable.
And again, thanks go out to The Trick for working out most of the low-level details on how to do this, and to Fafalone for putting together the oleexp.tlb which provides access to the Windows methods that do all the work.
The project is attached: