Microsoft Knowledge Base Email Alertz

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

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











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

On This Page

SYMPTOMS

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.

WORKAROUND

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.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

Steps to reproduce the problem

  1. 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.
  2. Start Visual Studio .NET 2003.
  3. On the File menu, point to New, and then click Project.
  4. Under Project Types, expand Visual C++ Projects, and then click ATL.
  5. Under Templates, click ATL Project.
  6. Type a name for the project, and then click OK. The ATL Project Wizard appears.
  7. Click Application Settings.
  8. Click to clear the Attributed check box, confirm that the server type is Dynamic-link library (DLL), and then click Finish.
  9. On the View menu, click Class View.
  10. In the Class View window, right-click the name of the project, point to Add, and then click Add Class.
  11. Under Categories, expand Visual C++, and then click ATL.
  12. Under Templates, click ATL Simple Object, and then click Open.
  13. Type a name for the object, and then click Finish.
  14. 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.
  15. 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.
  16. 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.

REFERENCES

For more information about the RegisterServer method, visit the following Microsoft Developer Network (MSDN) Web site:
http://msdn2.microsoft.com/en-us/library/3z6ak5ex(VS.80).aspx (http://msdn2.microsoft.com/en-us/library/3z6ak5ex(VS.80).aspx)
For more information about the LoadTypeLibEx method, visit the following MSDN Web site:
http://msdn2.microsoft.com/en-us/library/ms221249.aspx (http://msdn2.microsoft.com/en-us/library/ms221249.aspx)

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
Keywords: 
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