locked
How to expose different interface to different users through .idl files??

    Question

  • When I implement the .idl file of a WinRT component, I get a problem of exposing needed interfaces to users who need them.

    In the original COM component, even though my component have several interfaces, I still can expose the needed interfaces to the users. For example.

     

    Class A : public IA, public IB, public IC....

     

    I can expose some of them without exposing all of it.

    In the .idl file, how can I write it to achieve this purpose??

    I know one class can have several interfaces like the form below

    runtimeclass A

    {

    [default] interface IA;

                 interface IB;

    if IA and IB all inherit from interface IInspectable, do I see all interfaces when the class is activatable. Or I will see only the default interface and I can use some method to change interface like queryinterface??

    Thursday, November 24, 2011 6:48 AM

All replies

  • Does anyone have the clue about this??
    Friday, December 16, 2011 2:26 AM
  • As Larry mentioned earlier in the forum, the documentation has yet to be released on WinRT authoring in IDL. To address this specific question, you cannot selectively 'expose' selected interfaces implemented by a WinRT class. You would need two different WinRT classes in two different IDLs. One for external use and one for internal use.

     

    Thanks,

    -David

    Friday, December 16, 2011 10:45 PM
    Moderator