How to show mschart in design view in vs2022

min shan 20 Reputation points
2023-10-30T12:06:35.6666667+00:00

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
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,314 questions
{count} votes

Accepted answer
  1. RLWA32 36,801 Reputation points
    2023-11-03T14:14:32.46+00:00

    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 --

    dlgax1

    dlgax2

    dlgax3

    And the result --

    VS2022Ax

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. RLWA32 36,801 Reputation points
    2023-10-30T12:15:57.76+00:00

    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.