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.
Porting 32-bit dialog-based MFC app (C++) to 64-bit dialog-based MFC in Microsoft Visual Studio 2015 and 2022
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:
- Which ActiveX control are you using in your application?
- Is the ActiveX control present and registered on each system that you are using for your project?
- Are you building for 64-bits or 32-bits?
My Answers to the above:
- 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?
- 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.
- 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