What is a TLB file?
The TLB file is a description file. Through the TLB file, you can learn the COM interface and constant information in your DLL. It can be released separately or as a resource in the build DLL along with the component. You can view the constants, interfaces, and classes in the Object Browser of Vs, and the methods and attributes of each class. The various sdks provided by Microsoft usually include one or several TLB files for easy programming.
How to Create a TLB file?
You can use the midl.exe and IDL files to create the TLB file, [1, 2].
What is the intention of 1 typelib "projectname. TLB" in the RC file?
A component dll can contain multiple library files (TLB), and 1 represents the first library file. The serial number is required, so that you can use the serial number loadtypelib () and other methods to export the specified TLB from the DLL/EXE file.
How to Use TLB files?
You can release it along with the component. release method [3]:
1. Open the RC file in text format.
2. Add the following lines to the fields defined in textinclude:
3 TEXTINCLUDE DISCARDABLE BEGIN"1 TYPELIB ""ProjectName.tlb""\r\n" "\0"END |
Note: The number before textinclude increases progressively. It should be 1 larger than your existing textinclude.
3. Add the following lines at the bottom of the. RC file:
#ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 3 resource. // 1 TYPELIB "ProjectName.tlb" ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED |
Note: InTypelib "projectname. TLB"The preceding number increases progressively. 1 indicates the first TLB file.
What is textinclude?
Textinclude mainly contains three types [4]:
I. d. Type of set includes information
1 Symbol header file
2 read-only symbol ctictives
3 compile-time directives
This is what msdn explains:
The purpose of the textinclude resource is to safely store set include information in a form that is readily presentable in Visual C ++'s set already des dialog box. textinclude is a resource type defined
By Visual C ++. Visual C ++ recognizes three specific textinclude resources that have the resource identification numbers 1, 2 and 3.
The following is my translation:
The purpose of textinclude resources is to securely store include set information in a certain structure, so that it can be conveniently displayed in the endpoints set setting box of Visual C ++.
Textinclude is a type of resource defined by Visual C ++. Visual c ++ can identify three types of textinclude resources. Their identifiers are 1, 2, and 3.
Refer:
[1] http://topic.csdn.net/t/20010910/15/280442.html
[2] http://msdn.microsoft.com/en-us/library/windows/desktop/ms680078 (V = vs.85). aspx
[3] http://www.vckbase.com/english/code/atl/typelibres.shtml.htm
[4] http://topic.csdn.net/t/20060805/20/4929692.html