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

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

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.
23,684 questions
{count} votes

2 answers

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

    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. answered 2020-08-28T05:51:17.803+00:00
    Fay Wang - MSFT 5,121 Reputation points

    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.

    No comments