Concurrently using WinRT and Win32 in a C++ application

abhishek.m 46 Reputation points
2022-11-15T06:24:58.153+00:00

We are wanting to build an application which can also be deployed as a Service (with the UI switched off) – and the direction we are WANTING to take is:

  1. Build the core application using Windows APIs i.e. Win32 APIs (for multi-threading, communication, disk-IO, timer routines – including interfacing with device for network interfaces, sleep/wakeup, and other life-cycle events)
  2. Build the UI components ‘only’ using WinUI 3 (for all Visual UI including Printing, and User interaction)

We are expecting the shelf-life of our architecture to be several years from today for current and future evolutions of Windows.

From what we have read and understood so far, our interpretation is that WinRT (which is the gateway to WinUI 3) provides interfaces on top of Windows API (Win32) and does not conflict with being concurrently used in the same application. Is this true? Also, we would like to understand if there is anything we should be particularly careful about in this regard.

Thanks in advance.

Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
749 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,629 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Junjie Zhu - MSFT 16,551 Reputation points Microsoft Vendor
    2022-11-16T03:29:19.95+00:00

    Hi @abhishek.m ,
    Welcome to Micrsoft Q&A!

    Winui3 C++ project supports Win32 API and WinRT.
    The technical route you choose is feasible, and you can refer to the documentation below for relevant precautions.
    Create your first WinUI 3 (Windows App SDK) project

    Thank you.
    Junjie


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.