[C++/WinRT] How to configure VS to generate the .tlb file?

Dung Huynh 141 Reputation points
2023-06-29T04:28:26.01+00:00

Hi all,

In the C++ Dynamic Library project with Microsoft.Windows.CppWinRT nuget package installed, I need to generate the .tlb file (for now, it just generates the .winmd file).

This is my .idl file:

namespace SideBySideCpp 
{     
     runtimeclass SideBySideCppClass     
     {         
           SideBySideCppClass();         
           String Name;     
     } 
}

Could you tell me how to do it?

Thank you,

Dung Huynh.

Developer technologies | C++
{count} votes

1 answer

Sort by: Most helpful
  1. Minxin Yu 13,506 Reputation points Microsoft External Staff
    2023-06-30T06:29:20.36+00:00

    Hi,
    Winmd (Windows Metadata) in WinRT, is the modern version of the old TLB (type library) files from COM.
    And WinRT sets project properties: Generate Type Library: No

    Best regards,

    Minxin Yu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.