none
[UWP][Desktop Bridge][WPF] System.Speech RRS feed

  • Question

  • Hi everyone

    I have created a UWP app which requires the System.Speech reference. (The speech API in UWP does not have the features I need). Can I and How would I use the Desktop Bridge to bring in this one needed reference so I could use it in my UWP app.

    I don't want to convert the UWP app to a WPF app just to reference this one library. I would not mind creating another library project which contain the reference.

    Note that the UWP app uses UWP extension and app services to extend the functionality of it. Not sure if thats relevant.

    thanks

    Ayako



    • Edited by hypodyne1 Tuesday, April 4, 2017 9:30 PM
    Monday, April 3, 2017 6:35 AM

Answers

  • Hi,

    There is nothing you cannot access in the Desktop space from UWP.

    I have been able to call Win32 routines like MessageBoxA using platform Platform/Invoke. Only caveat is they run in a sandbox and you could not do all that magic that you would as in Win32.

    So I would suggest you could go for a C++ Win32 dll and use platform/invoke to call from the UWP. Your code is sure to compile, but as the whole thing runs in one sandbox some calls depending on their privilege in UWP might fail at runtime.

    Or going for a managed .net  .dll  with your preferred System.Speech and calling from UWP might also work, but I don't have hands-on experience calling managed desktop libraries from UWP.

    Ravi

    • Marked as answer by hypodyne1 Sunday, April 16, 2017 9:10 AM
    Sunday, April 9, 2017 11:36 AM

All replies

  • Hi hypodyne1,

    Welcome to the Developing Universal Windows apps forum! Please utilize tagging when posting to this forum, thanks!

    The Desktop Bridge is a set of technologies that enable you to convert your Windows desktop application (for example, Win32, Windows Forms, or WPF) or game to a UWP app or game. After conversion, your Windows desktop application is packaged, serviced, and deployed in the form of a UWP app package (an .appx or an .appxbundle) targeting Windows 10 Desktop. You can get more in Desktop to Universal Windows Platform (UWP) Bridge.

    Windows 10 Universal Windows Platform (UWP) apps and Windows 8.x apps can use a subset of the Win32 and COM APIs. This subset of APIs was chosen to support key scenarios for Windows Runtime apps that were not already covered by the Windows Runtime, HTML/CSS, or other supported languages or standards. Refer to Win32 and COM APIs.

    In this topic, do you want to use some Api from the Win32 and COM? If that, you should make sure the APIs is available, There is a reference to Win32 and COM APIs for UWP apps.

    Best regards,

    Breeze


    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.

    • Edited by Breeze Liu Tuesday, April 4, 2017 9:43 AM
    Tuesday, April 4, 2017 9:42 AM
  • There does not seem to be a way of adding a reference to System.Speech in a UWP app even with the bridge.

    So now I have to rewrite my UWP app to a WPF app.


    • Edited by hypodyne1 Monday, April 10, 2017 10:11 AM Removing bad attitude.
    Sunday, April 9, 2017 10:27 AM
  • Hi,

    There is nothing you cannot access in the Desktop space from UWP.

    I have been able to call Win32 routines like MessageBoxA using platform Platform/Invoke. Only caveat is they run in a sandbox and you could not do all that magic that you would as in Win32.

    So I would suggest you could go for a C++ Win32 dll and use platform/invoke to call from the UWP. Your code is sure to compile, but as the whole thing runs in one sandbox some calls depending on their privilege in UWP might fail at runtime.

    Or going for a managed .net  .dll  with your preferred System.Speech and calling from UWP might also work, but I don't have hands-on experience calling managed desktop libraries from UWP.

    Ravi

    • Marked as answer by hypodyne1 Sunday, April 16, 2017 9:10 AM
    Sunday, April 9, 2017 11:36 AM
  • Calling a managed .net dll would be ideal. But it does not seem possible. In the UWP Apps manifest you must specify an exe file.
    Sunday, April 9, 2017 12:41 PM
  • Gave up on this, found a way to make my own Visemes since its not possible to add a reference.
    Sunday, April 16, 2017 9:09 AM