BUG: Tlbimp.exe creates a partial wrapper when the imported type library has dependencies on other unregistered libraries (327130)



The information in this article applies to:

  • Microsoft Visual Studio .NET (2002), Academic Edition
  • Microsoft Visual Studio .NET (2002), Professional Edition
  • Microsoft Visual Studio .NET (2002), Enterprise Developer Edition
  • Microsoft Visual Studio .NET (2002), Enterprise Architect Edition

This article was previously published under Q327130

SYMPTOMS

The Type Library Importer tool (Tlbimp.exe) creates a partial wrapper when the imported type library has dependencies from other unregistered libraries. This partial wrapper has limited functionality and it is not guaranteed to function correctly (even partially).

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce the Behavior

  1. Open a text editor, and then use the following code to create the 1.idl file:
    
       [uuid(24b4580a-3c4d-412c-b83d-4e8917af07a2)]
       library One
       {
           importlib("stdole2.tlb");
    
       	[
       		odl,
       		uuid(2be7bcfc-e450-4431-9a10-323f7b6d51bc)
       	]
       	interface One : IUnknown
       	{
       	};
       };
    					
  2. Create the 2.idl file that references type library "One":
       [uuid(6f225a10-3c20-4705-a2ac-2e872d943b0e)]
       library One
       {
           importlib("1.tlb");
    
       	[
       		odl,
       		uuid(82f08559-73b6-4093-884b-840f7c69b10f)
       	]
       	interface Two: One
       	{
       	};
       };
    					
  3. Compile these .idl files:
    1. Click Start, click Programs, and then click Microsoft Visual Studio .NET.
    2. In Visual Studio .NET, on the Tools menu, click Command Prompt.
    3. Run the following commands to compile the .idl files:
         C:\>midl /win32 1.idl
         C:\>midl /win32 2.idl
      						
  4. Verify the creation of the 1.tlb and 2.tlb files.
  5. Generate the COM Interop assembly by using the Tlbimp.exe tool:
       C:\>tlbimp 2.tlb
    					
Although 1.tlb is not registered, the command runs without a problem and it does not generate any errors or warning messages.

REFERENCES

For additional information, click the article number below to view the article in the Microsoft Knowledge Base:

317157 PRB: Errors When You Reference the Access 10.0 Type Library with Visual Studio .NET


Modification Type:MinorLast Reviewed:9/13/2005
Keywords:kbvs2002sp1sweep kbbug kbCOMInterop kbpending KB327130 kbAudDeveloper