Skip to content

How can I use APIs not allowed under an UWP app in a runtime component that needs to work in both UWP and desktop apps? #858

Answered by orcmid
JaiganeshKumaran asked this question in Q&A
Discussion options

You must be logged in to vote

There are a few of ways this has been handled traditionally. Some apply at build time, so there need not be any conditional choice at run time, for a smaller code footprint and more understandability. One might satisfy app certification. I imagine you know these cases. But, for the record:

In C/C++ there is the use of conditional pre-processor selections and build options. That Unix tradition is probably worth avoiding. This means you have to build different releases for the different dependency cases but confirmation of cases gets messy.

Another way is to create an abstracted interface of what you want and then implementing it two (or more) different ways. The build configuration causes …

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by andrewleader
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #853 on May 24, 2021 19:13.