Share via

CPP WINRT API is not working in CPP Console App

Jone Selas 81 Reputation points
2021-12-03T13:12:21.067+00:00

We are trying to implement the UWP Radio Manager program in a seperate CPP console where the function below is returning NULL.

for (Radio radio : co_await( Radio::GetRadiosAsync()))

Can you help us in implementing this in a CPP console?

https://github.com/Microsoft/Windows-universal-samples/tree/main/Samples/RadioManager

Developer technologies | Universal Windows Platform (UWP)
0 comments No comments

Answer accepted by question author

Castorix31 91,876 Reputation points
2021-12-04T09:55:08.23+00:00

You must compile as x64 if the OS is x64 : there is in the doc at Radio.GetRadiosAsync :

When this method is called from a desktop application (Win32), it will retrieve radio instances only when the application is natively compiled for the target architecture
(in other words, when the application matches the computer architecture; so an x86 application running on an x64 architecture computer won't see any radio instances).

Was this answer helpful?


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.