Article ID: 317217 - Last Review: January 5, 2006 - Revision: 2.0 How to use the #import directive to target a specific type library resource ID from a file in Visual C++ .NET or in Visual C++ 2005
This article was previously published under Q317217 On This PageSUMMARY This step-by-step article describes how you can use the #import directive to target a specific type library resource ID from a
single .dll file or from a single .exe file. By default, the type library is
extracted from the first resource of type TypeLib. You can use the tlbid(n) attribute with the #import directive, where n is the resource ID of the type library that you want to use.
Using #importIf multiple type libraries are built into a single .dll file or a single .exe file, you can use the #import directive to target a specific type library resource. For example, to target the type library resource 2, use the following tlbid switch:By default, the type library is extracted from the first resource of type TypeLib, if the tlbid directive is missing. When you use this tlbid switch, you get the same results that you get when you use the LoadTypeLib("SERVER.DLL\\2") API call. REFERENCES For other top-hit Visual C++ .NET Microsoft Knowledge Base
articles, visit the following Microsoft Web site:
Visual C++ .NET (2002) Support Center http://support.microsoft.com/default.aspx?xmlid=fh%3BEN-US%3Bvcnet (http://support.microsoft.com/default.aspx?xmlid=fh%3ben-us%3bvcnet) | Other Resources Other Support Sites
CommunityGet Help NowArticle Translations
|






Windows Live
Facebook
Twitter
Linkedin
Digg it
Yahoo
Delicious
StumbleUpon
Yammer
Reddit
Technorati
FriendFeed
Email
Back to the top
