Porting 32-bit dialog-based MFC app (C++) to 64-bit dialog-based MFC in Microsoft Visual Studio 2015 and 2022

AndyNguyen-8038 0 Reputation points
2024-07-02T17:43:10.71+00:00

I have 3 PCs with the following configurations:

PC-A has Windows 10 (64-bit) with installed Microsoft Office 2016 (32-bit). Visual Studio 2015 has Target Platform Version= 10.0.26100.0; Platform Toolset = v140; Use of MFC = Use MFC in a shared DLL (non-static Libray). The app was originally developed on 32-bit and therefore, everything was built and run successfully.

PC-B has Windows 10 (64-bit) with installed Microsoft Office 2016 (64-bit). Visual Studio 2015 has Target Platform = 10.0.26.100.0; Platform Toolset = v140; Use of MFC = Use MFC in a shared DLL (non-static Libray).

PC-C has Windows 11 (64-bit) with installed Microsoft O365 (64-bit). Visual Studio 2022 has Target Platform = 10.0.26100.0; Platform Toolset = v143; Use of MFC = Use MFC in a shared DLL (non-static Libray).

The vcxproj was copied from PC-A to both PC-B and PC-C. With some minor modifications to code and path in terms of 64-bit, the app was built successfully without warnings and errors on both. However, at run time, on both PC-B and PC-C have exactly the same error as followed:

Debug Assertion Failed!

Program: C:\Windows\System32\mfc140ud.dll

File: D:\a_work\1\s\src\vctools\VC7Libs\Ship\ATLMFC\Src\MFC\occcont.cpp

Line: 926

For more information on how your program can cause an assertion failure, se the Visual C++ documentation on asserts.

(Press Retry to debug the application)

I read the previous posting "Migrating solutions among VisualStudios 2015 and VisualStudios 2019" dated June 30, 2021 and there were some questions asked by RLWA32:

  1. Which ActiveX control are you using in your application?
  2. Is the ActiveX control present and registered on each system that you are using for your project?
  3. Are you building for 64-bits or 32-bits?

My Answers to the above:

  1. I don't know which ActiveX control is used in the application. How do I find out that since the code and libraries are all in the Visual Studio 2015 and 2022?
  2. I don't know. I am assuming the installation of Microsoft Office products (Microsoft Office 2016 64-bit or Microsoft O365 64-bit) would register for all.
  3. I am building for 64-bits.

RLWA32 also gave the solution on Jul 3, 2021, 5:32 AM as followed:

"The root cause of the problem is either a completely unregistered ActiveX control or a difference between the bitness of the registered ActiveX control and the bitness of the MFC dialog-based application. Both problems trigger the debug assertion from the MFC dialog-based application.

A 64-bit version of the control must be registered for a 64-bit application and a 32-bit version of the control must be registered for use in a 32-bit application."

My questions are:

How do I check for registered ActiveX control?

The bitness of the registered ActiveX control and the bitness of the MFC dialog-based application which triggered the debug assertion from the MFC dialog-based application. This is something I have to look at the code but I truly need help in identifying where the registered ActiveX control is?

Thank you in advance for your help. I'd appreciate it very much.

Sincerely,

Andy N

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,721 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
9,901 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AndyNguyen-8038 0 Reputation points
    2024-08-13T18:58:58.4366667+00:00

    Any add-ins from 3rd party company in the app will need to be upgraded to 64-bit from 32-bit. Note: 64-bit DLLs and ActiveX controls have to be registered using the 64-bit Regsvr32 (i.e., %systemroot%\System32\regsvr32.exe) before actual use.

    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.