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.

Developer technologies C++
Developer technologies Visual Studio Other
{count} votes

Accepted answer
  1. RLWA32 49,536 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 49,536 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.


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.