Adding Type Libraries as Resources to .DLL and .EXE FilesLast reviewed: March 15, 1996Article ID: Q122285 |
The information in this article applies to:
A type library can be added as a resource to an .EXE or .DLL file by using the following statement in the .RC file:
1 typelib TEST.TLBTEST.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.
|
Additional reference words: 2.00 Automation
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |