From: http://blog.csdn.net/lcl_data/article/details/7418387
What is a TLB file?
The TLB file is a description file that, through the TLB file, allows the user to learn about the COM interfaces in your DLL, as well as constants. It can be released separately or as a resource in the build DLL with the component. You can see in the Object Browser vs what constants, interfaces, classes, and what methods and properties are included in the file. Microsoft provides a variety of SDKs that typically include one or several TLB files for easy programming.
How do I create a TLB file?
The TLB file can be created using MIDL.exe and IDL files.
RC file inside 1TYPELIB "Projectname.tlb" intent?
A component DLL can contain more than one type library file (TLB), and 1 represents the first type library file. The sequence number is required so that the customer can use the ordinal to export the specified TLB from the Dll/exe file using the LoadTypeLib () method.
How do I use a TLB file?
You can release him along with the component, release method [3]:
1. Open the RC file in text mode.
2. Add the following line where Textinclude is defined:
3 Textinclude discardable
BEGIN "1 TYPELIB
"Projectname.tlb" "\ r \ n"
"+" END
Note: The number in front of the textinclude is incremented, and he should be 1 larger than the textinclude you already have.
3. Add the following line 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: The number in front of the typelib "Projectname.tlb" is also incremented, where 1 represents the first TLB file.
What's textinclude?
Textinclude is mainly comprised of three species [4]:
I.D. Type of Set includes information
1 Symbol Header File
2 read-only Symbol directives
3 Compile-time directives
This is the MSDN explanation for it:
The purpose of the Textinclude resource is to safely store Set Include information in a form which is readily presentable I n Visual C + + ' s Set includes dialog box. Textinclude is a resource type defined by Visual C + +. Visual C + + recognizes three specific textinclude resources that has the resource identification numbers 1, 2 and 3.
Here is my translation:
The purpose of the Textinclude resource is to safely store the Include collection information in a structured form, so that he can easily display it in the Visual C + + includes collection settings box.
Textinclude is a resource type defined by Visual C + +. Visual C + + is able to identify a specific 3 textinclude resources whose identification numbers are three-to-one.
Reference:
[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
About TLB Files