none
How to use a C++/Cx dll into a Win32 C++ project RRS feed

  • Question

  • Hello,


    I have writeen a Window Runtime Component in C++.

    Now I want to using it in my Win32 C++ app. BUt when I try to add the reference from this project to the WindowRuntime C++ lib, it failed because they are different platform target.

    I read this article but it just mentioned how to using a WindowRuntime C++ into a C# project, not for C++ desktop.


    Could you please help me know how i could achieve my goal?


    Thank a lot!



    • Edited by Tan174 Thursday, June 6, 2019 4:29 AM
    Tuesday, June 4, 2019 9:37 AM

Answers

  • Hello,

    Have a look at this link: Enhancing Non-packaged Desktop Apps using Windows Runtime Components

    Best Wishes,

    Jack Zhang


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Tan174 Tuesday, June 11, 2019 1:24 AM
    Wednesday, June 5, 2019 3:01 AM

All replies

  • Hi, Tan174

    The way to package an existing Win32 application and to leverage the Desktop Bridge is to add a new Windows Application Packaging Project in our solution. 

    Here is Link can solve your problem.

    Best regards,

    Strive


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Wednesday, June 5, 2019 2:01 AM
  • Hello,

    Have a look at this link: Enhancing Non-packaged Desktop Apps using Windows Runtime Components

    Best Wishes,

    Jack Zhang


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Tan174 Tuesday, June 11, 2019 1:24 AM
    Wednesday, June 5, 2019 3:01 AM
  • Hi Strive,

    Thank for your reply!

    A already read this link before, but as I has mentioned that I want to using a C++  Window Runtime Component (the main reason is that I want to reuse the existing lib for the UWP projects- but now we want to just write a C++ Win32 with Desktop bridge to pack the uwp) into a C++ win32 project, but the example in this article was using a Window Runtime compoment into a C# project.

    Is there any way to do that? (using function in NotificationsComponent dll from My_win32)

    (because of i'm not allow to post the link/images so below is the quick detail of my solution)

    MySolution

    - App_package

    - NotifcationsComponents (C++/Cx dll)

    - My_Win32 (Win32 C++ project)



    • Edited by Tan174 Thursday, June 6, 2019 4:01 AM
    Wednesday, June 5, 2019 7:24 AM
  • Hi ,Tan174

    According to the information provided on the MSDN, *This topic shows how to use C++/CX to create a Windows Runtime component, which is a component that's callable from a Universal Windows app built using C#, Visual Basic, C++, or Javascript.*

    In theory, Windows Runtime component can be called by Win32 C++.But I didn't find DEMO on MSDN either.

    If possible , you can refer @JACK ZHANG Link.

    Best regards,

    Strive


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Thursday, June 6, 2019 9:51 AM