Can WinUI Desktop App (C++) access MFC classes such as CString, CArray etc.

Denson P D 6 Reputation points
2020-08-27T14:27:53.52+00:00

In an MFC application, there will be logic implemented in event handlers and those logics may contain MFC classes.

  • While migrating an MFC UI to WinUI application, is it possible to re-use those logics containing MFC classes CString, CArray etc?
  • Is it possible to include a library which has MFC dependency in WinUI Desktop Application?
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
38,659 questions
{count} votes

2 answers

Sort by: Most helpful
  1. WayneAKing 4,921 Reputation points
    2020-08-27T21:56:33.273+00:00

    Clarify what you mean by a "WinUI" app.

    If you mean a traditional Win32(64) program that has
    WinMain, WndProc, etc. then yes you can use MFC classes
    such as CString.

    You can easily prove it by using the VS template to create
    a Win32 app and add code to the generated program to create
    and use one or more of those MFC classes.

    • Wayne

  2. Fay Wang - MSFT 5,211 Reputation points
    2020-08-28T05:51:17.803+00:00

    Hello,

    Welcome to Microsoft Q&A!

    Currently, Microsoft Q&A supports the products listed over here: supported topics (more to be added later on).

    Your question about winui 3 is not supported yet now. You could ask this in winui_github.

    Thanks.

    0 comments No comments

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.