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 development | Windows App SDK
Developer technologies | C++
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Junjie Zhu - MSFT 21,646 Reputation points
    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.


Your answer

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