You can add a type library as a resource to an .exe or .dll file by using
the following statement in the .rc file:
Test.tlb is the type library to be added as a resource.
If a type library is added as a resource, a separate .tlb file need not be
shipped with the application. LoadTypeLib() and LoadRegTypeLib() can be
used to load the type library from the .exe or .dll file in which it exists
as a resource.
NOTE: OLE version 2.02 or higher is needed to read a type library from an
.exe file.
An .exe or .dll file can contain multiple typelib resources. For example:
1 typelib Test1.tlb
2 typelib Test2.tlb
Test1.tlb and Test2.tlb are type libraries to be added as resources.
By default, LoadTypeLib extracts the type library from the first resource
of type typelib. To load a different type library resource, append an
integer index to the szFileName parameter of LoadTypeLib. For example:
LoadTypeLib(OLESTR("c:\\test.exe\\2"), &ptlib);
This statement loads the type library resource 2 from Test.exe.