Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 922277 - Last Review: December 12, 2006 - Revision: 1.1
BUG: Visual Studio .NET 2003 may not list all the type libraries that are embedded as resources in an ATL executable file when you use the Implement Interface wizard to implement an interface in the ATL project
Consider the following scenario. You create a Microsoft Active Template Library (ATL) executable file. Two or more type libraries are embedded as resources in the ATL executable file. You register all the type libraries. In Microsoft Visual Studio .NET 2003, you create a new ATL DLL project. You add an ATL simple object to the project, and then you use the Implement Interface wizard to implement an interface.
In this scenario, only one of the type libraries that are embedded in the ATL executable file appears.
Note This problem occurs when you select the
Registry option in the Implement Interface wizard. However, all the type libraries are listed correctly when you select the
File option in the Implement Interface wizard and then you select the ATL executable file.
To work around this problem, modify the
RegisterServer method in the ATL executable file. The
RegisterServer method should register additional type libraries by passing the .tlb file name to the
LoadTypeLibEx method in the
szFile parameter.
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.
Steps to reproduce the problem
- Register an ATL executable file that contains multiple type libraries. To do this, click Start, click Run, type Path /regserver, and then click OK.
Note Path represents the path and file name of the ATL executable file. For example, type C:\Test\ATLServer.exe. - Start Visual Studio .NET 2003.
- On the File menu, point to New, and then click Project.
- Under Project Types, expand Visual C++ Projects, and then click ATL.
- Under Templates, click ATL Project.
- Type a name for the project, and then click OK. The ATL Project Wizard appears.
- Click Application Settings.
- Click to clear the Attributed check box, confirm that the server type is Dynamic-link library (DLL), and then click Finish.
- On the View menu, click Class View.
- In the Class View window, right-click the name of the project, point to Add, and then click Add Class.
- Under Categories, expand Visual C++, and then click ATL.
- Under Templates, click ATL Simple Object, and then click Open.
- Type a name for the object, and then click Finish.
- In the Class View window, right-click the name of the ATL Simple Object that you created, point to Add, and then click Implement Interface.
- Under Implement interface from, click Registry.
In the Available type libraries list, notice that only one of the type libraries that is contained in the ATL executable file appears in the Interfaces box. - Under Implement interface from, click File, and then open the ATL executable file location.
In the Available type libraries list, notice that both type libraries appear in the Interfaces box.
For more information about the
RegisterServer method, visit the following Microsoft Developer Network (MSDN) Web site:
For more information about the
LoadTypeLibEx method, visit the following MSDN Web site:
APPLIES TO
- Microsoft Visual Studio .NET 2003 Professional Edition
- Microsoft Visual Studio .NET 2003 Enterprise Architect
- Microsoft Visual Studio .NET 2003 Enterprise Developer
- Microsoft Visual Studio .NET 2003 Academic Edition
- Microsoft Visual C++ .NET 2003 Standard Edition
| kbexpertiseinter kbtshoot kbbug KB922277 |
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate
Be the first to leave feedback, to help others about this knowledge base
article.
(Optional) Name
(Optional)
Public URL Or Email
Comments
No
HTML -- Text Only Please