How to show mschart in design view in vs2022

min shan 20 Reputation points

I upgraded a legacy MFC project to vs2022. One dialog in this project contains Microsoft Chart Control. So I copy the file "MSCHRT20.OCX" to "Windows\SysWOW64" folder and regist it using regsvr32 command. After thar, I opened the project and built it. There is no error. Then I ran the application built from the project. It can show the chart normally. But if I want to open the dialog in vs2022's design view, it disply the error info indicading the control is not registered instead of displying controls in that dialog. I found there was no Microsoft Chart Control in the list of COM components of toolbox, so I tryed to import the control by browsing and selecting the file "MSCHRT20.OCX". But it also report error that regist the control failed.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,084 questions
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,314 questions
{count} votes

Accepted answer
  1. RLWA32 36,801 Reputation points

    Another possibility is to do a manual edit to the .rc file so that the ActiveX control is not loaded in the dialog editor but is still included when building.

    Surround the related resource statements for conditional compilation --




    And the result --


    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. RLWA32 36,801 Reputation points

    I expect the reason that you cannot instantiate this old 32-bit .OCX in the dialogue editor is because Visual Studio 2022 is a 64-bit application.