winrt-api | WinRT reference content for developing Microsoft Universal | Runtime Evironment library

 by   MicrosoftDocs JavaScript Version: Current License: CC-BY-4.0

kandi X-RAY | winrt-api Summary

kandi X-RAY | winrt-api Summary

winrt-api is a JavaScript library typically used in Server, Runtime Evironment applications. winrt-api has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

WinRT reference content for developing Microsoft Universal Windows Platform (UWP) apps
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              winrt-api has a low active ecosystem.
              It has 210 star(s) with 528 fork(s). There are 60 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 262 open issues and 1310 have been closed. On average issues are closed in 213 days. There are 3 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of winrt-api is current.

            kandi-Quality Quality

              winrt-api has 0 bugs and 0 code smells.

            kandi-Security Security

              winrt-api has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              winrt-api code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              winrt-api is licensed under the CC-BY-4.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              winrt-api releases are not available. You will need to build from source code and install.
              It has 13938 lines of code, 0 functions and 1504 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of winrt-api
            Get all kandi verified functions for this library.

            winrt-api Key Features

            No Key Features are available at this moment for winrt-api.

            winrt-api Examples and Code Snippets

            No Code Snippets are available at this moment for winrt-api.

            Community Discussions

            QUESTION

            Can C++ coroutines contain plain `return` statements?
            Asked 2022-Jan-23 at 20:51

            I am writing a C++ coroutine for a UWP control using C++/WinRT:

            ...

            ANSWER

            Answered 2022-Jan-23 at 20:51

            This seems to be a legacy implementation for MSVSC. MSVSC implemented coroutines before the standard was formally complete, so there are two implementations of async (/async and /async:strict). I seem to have the old, non–standard-compliant version turned on.

            The standard is clear that you cannot use plain return statements in coroutines (emphasis added):

            Coroutines cannot use variadic arguments, plain return statements, or placeholder return types (auto or Concept). Constexpr functions, constructors, destructors, and the main function cannot be coroutines.

            https://en.cppreference.com/w/cpp/language/coroutines

            You can verify that this is a legacy behavior with a simple example (view in Godbolt):

            Source https://stackoverflow.com/questions/70792678

            QUESTION

            WinUI 3 Desktop XAML Databinding - WinRT originate error - 0x8001010E when the Property is changed
            Asked 2021-Sep-09 at 18:09

            I am following the BookStore data binding example, documented at XAML controls; bind to a C++/WinRT property, up to and including the "Bind the button to the Title property" section.

            My starting point is a new "Blank App, Packaged (WinUI 3 in Desktop)" project in Visual Studio.

            [EDIT] Starting from a "Blank App (C++/WinRT)" project, which is for UWP apps, works perfectly. The problem persists with "WinUI 3 in Desktop" projects.

            The initial data binding works and the button content L"Atticus" is read from the BookSku title property. However calling MainViewModel().BookSku().Title(L"To Kill a Mockingbird"); in the click handler, as directed in article, throws the exception

            Exception thrown at 0x00007FFC801B4ED9 (KernelBase.dll) in BookStore.exe: WinRT originate error - 0x8001010E : 'The application called an interface that was marshalled for a different thread.'.

            Stepping through the code, the call

            m_propertyChanged(*this, Windows::UI::Xaml::Data::PropertyChangedEventArgs{ L"Title" });

            in void BookSku::Title(hstring const& value) is where the exception is thrown from within.

            I can change the button content manually, not through the binding property.

            The first example in the Data binding in depth article describes a very similar, though slightly less complicated, data binding scenario. It throws the same exception.

            I am using latest Microsoft.Windows.CppWinRT version 2.0.210825.3 and Windows App SDK version 0.8.3

            ...

            ANSWER

            Answered 2021-Sep-09 at 02:42

            The application called an interface that was marshalled for a different thread

            The problem is you update the property in the no-uithread, so it will throw the above exception, you could use the following to go back to ui-thread before updating the property.

            Source https://stackoverflow.com/questions/69110367

            QUESTION

            How to connect to bluetooth device on Windows?
            Asked 2021-Jul-28 at 08:20

            I would like to allow the user to connect to paired audio devices directly from the app instead of navigating to the bluetooth settings manually.

            I am successfully listing all bluetooth devices using WinRT Apis:

            ...

            ANSWER

            Answered 2021-Jul-27 at 19:35

            Why would you ever expect that the following line would work:

            private const string bluetoothDll = "bthprops.cpl";

            when MSDN's page states:

            DLL: Bthprops.dll

            ?

            Source https://stackoverflow.com/questions/68550324

            QUESTION

            Error "A dependent dll was not found" in C++/WinRT project while using OpenSSL-1.1.1g
            Asked 2020-Sep-23 at 06:53

            I would like to use OpenSSL-1.1.1g in a C++/WinRT project. So i created a test project. The below is what did i do in this project:

            1.Install C++/WinRT in VS2019

            2.Create project "TestOpenSSL1.1.1g" in the directory "c:\temp" (File->New->Project->Blank App(C++/WinRT))

            3.Install Strawberry Perl and NASM

            4.Download OpenSSL-1.1.1g and extract it to "c:\temp\openssl-1.1.1g"

            5.Open "Developer Command Prompt for VS 2019" with "Run as Administrator"

            6.Enter the directory "openssl-1.1.1g"

            cd c:\temp\openssl-1.1.1g

            7.Configure openssl

            perl configure VC-WIN32 --prefix="c:\temp\TestOpenSSL1.1.1g\openssl-1.1.1g"

            8.Compile openssl

            nmake

            9.Install openssl

            nmake install

            10.So i saw the directories "bin" "html" "include" "lib" were created in "c:\temp\TestOpenSSL1.1.1g\openssl-1.1.1g"

            11.Include openssl header files

            Add "$(ProjectDir)..\openssl-1.1.1g\include" in Solution Explorer->Properties->Configuration properties->C/C++ ->General->Additional include directories

            12.Add dependencies "libcrypto.lib" and "libssl.lib"

            Add "$(ProjectDir)..\openssl-1.1.1g\lib\libcrypto.lib;$(ProjectDir)..\openssl-1.1.1g\lib\libssl.lib" in Solution Explorer->Properties->Configuration properties->Linker->Input->Additional dependencies

            13.Modify MainPage.cpp

            #include

            Add statement "OPENSSL_init();" in function "MainPage::MainPage";

            After all these I built this project, there was no error. but if i debug this project the errors came:

            ...

            ANSWER

            Answered 2020-Sep-23 at 06:53

            It works after using the source codes from openssl and configuring with command "perl Configure VC-WIN32-UWP"

            Source https://stackoverflow.com/questions/63739424

            QUESTION

            Error C2664 'HRESULT IUnknown::QueryInterface(const IID &,void **)': cannot convert argument 1 from 'const winrt::guid' to 'const IID &'
            Asked 2020-Aug-21 at 19:22

            This error happens to me when I use the helper function from microsoft docs to migrate to winrt from cx. I see a similar question here, but the solution mentioned doesn't seem to work for me. The solution mentioned here add #include before any other winrt headers in the file which has this error.

            ...

            ANSWER

            Answered 2020-Aug-13 at 14:20

            winrt::guid_of() returns a winrt::guid. Per What's new in C++/WinRT:

            • Breaking change. GUID is now projected as winrt::guid. For APIs that you implement, you must use winrt::guid for GUID parameters. Otherwise, winrt::guid converts to GUID, as long as you include unknwn.h before you include any C++/WinRT headers. See Interoperating with the ABI's GUID struct.

            Per Interoperating with the ABI's GUID struct:

            GUID is projected as winrt::guid. For APIs that you implement, you must use winrt::guid for GUID parameters. Otherwise, there are automatic conversions between winrt::guid and GUID as long as you include unknwn.h (implicitly included by and many other header files) before you include any C++/WinRT headers.

            If you don't do that, then you can hard-reinterpret_cast between them.

            So, either make sure unknwn.h is included before WinRT headers, or else you can reinterpret_cast explicitly, eg:

            Source https://stackoverflow.com/questions/63382869

            QUESTION

            Error related to headers and namespaces when migrating from C++/CX to C++/WinRT
            Asked 2020-Aug-12 at 18:00

            File.h:

            ...

            ANSWER

            Answered 2020-Aug-04 at 22:26

            std::map::find returns an iterator. An iterator doesn't have first or second members, unlike the actual items of the map. If you want to access the item, you need to dereference the iterator, either by using the * or the -> operators:

            Source https://stackoverflow.com/questions/63255818

            QUESTION

            Converting a winrt::UI::Xaml::Controls::TextBlock object to C++/CX object
            Asked 2020-Aug-10 at 09:12

            I am porting my project from C++/CX to C++/WinRT. For this I need to do some interop stuff like this: https://docs.microsoft.com/en-us/windows/uwp/cpp-and-winrt-apis/interop-winrt-cx.

            Microsoft recommends using helper functions like these for interoperability.

            from_cx and to_cx functions The helper function below converts a C++/CX object to an equivalent C++/WinRT object. The function casts a C++/CX object to its underlying IUnknown interface pointer. It then calls QueryInterface on that pointer to query for the default interface of the C++/WinRT object. QueryInterface is the Windows Runtime application binary interface (ABI) equivalent of the C++/CX safe_cast extension. And, the winrt::put_abi function retrieves the address of a C++/WinRT object's underlying IUnknown interface pointer so that it can be set to another value.

            ...

            ANSWER

            Answered 2020-Aug-10 at 09:12

            Converting a winrt::UI::Xaml::Controls::TextBlock object to C++/CX object

            If you want to port a C++/WinRT object to a C++/CX object. You could make Windows Runtime Component(C++/WinRT) project for the solution and put the converting code in it. Then make the C++/WinRT project refer the above Component (Right click the C++/WinRT project name int the Solution Explorer, click Add, choose References, select the component name you just added under Projects in the Add Reference dialog).

            Note

            You need to use Consume Windows Runtime Extension>Yes(/ZM) in the Windows Runtime Component(C++/WinRT) project instead of the C++/WinRT project.

            Then, in the Windows Runtime Component(C++/WinRT), add cx namespace and winrt namespace to distinct the different object using different language.

            The following code can be put into your component project’s class.

            Add the needed headers such as:

            Source https://stackoverflow.com/questions/63291853

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install winrt-api

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/MicrosoftDocs/winrt-api.git

          • CLI

            gh repo clone MicrosoftDocs/winrt-api

          • sshUrl

            git@github.com:MicrosoftDocs/winrt-api.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link