Accessing COM Object from WinRT Component

baget 221 Reputation points
2019-12-31T11:58:19.903+00:00

I would like to write a WinRT (C++) component that access my COM Object.
in order to do that I need the COM Object Interface definitions, so I'm using #import with raw_interfaces_only

e.g.

#import "libid:ee10004c-2d77-4289-bb93-d6def17881dd" raw_interfaces_only  

the problem is that I'm getting the following error on the autogenerate .tlh file:

fatal error C1075: '{': no matching token found  

The same code works fine in regular windows console application.

According to this link COM Consuming is supported by WinRT, so it is not clear how can I import my Interface to WinRT C++ Project.

How do I import my COM Interfaces definition to my WinRT C++ Project?

Universal Windows Platform (UWP)
0 comments No comments
{count} vote

Accepted answer
  1. baget 221 Reputation points
    2019-12-31T13:00:14.267+00:00

    I used midl.exe this cause to generate a .H file that contains all of the definition and compile fine in WinRT component.

    (I was not able to make it work, but it compile)

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

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.