Click here to Skip to main content
15,843,200 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When one of my visual studio 2006 c++ MFC projects migrates to the VS 2019, there are some problems loading dialogs in run time. the following debug assertion messages appear:

"Program: C:\Windows\SYSTEM32\mfc140d.dll
File: d:\agent\_work\3\s\src\vctools\VC7Libs\Ship\ATLMFC\Src\MFC\occcont.cpp
Line: 925
For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts."

when I tried to debug I understand that calling the DoModal() function of dialog initialization caused this event.
besides, when I want to open the dialog in the IDE, this message is shown:
"2 Activex controls could not be instantiated. reinstall or register controls and try again".
so I can't access the dialog form. I don't know which Activex controls have been used and I am not able to discover them since the dialog is not openable. Note that, This project has run without any problem on the VS2006, before.

What I have tried:

I search in my system but there is no "occcont.cpp".
I tried to understand which Activex controls must be reinstalled but I can't.
I don't know what I must do
Afzaal Ahmad Zeeshan 30-Oct-22 8:31am    
I would suggest reinstalling Visual C++ distribution that you received, or the framework that you installed.

It is unclear what went wrong and we cannot help without knowing the historic data. :)
Richard MacCutchan 30-Oct-22 9:49am    
You can check the dialog source by opening the project's .rc file in a text editor. But you may find that ActiveX controls are no longer supported: see ActiveX Controls | Microsoft Learn[^].
Alireza Mahini 1-Nov-22 4:16am    
thanks for your comment. I read the rc file and it seems that pen and text control ( for changing the font, pen color setting, text rotation,...) have been applied in that dialog.
Richard Deeming 31-Oct-22 5:33am    
NB: As far as I can see, there was no "Visual Studio 2006" version. There was no version between the 2005 and 2008 releases.
Alireza Mahini 1-Nov-22 4:12am    
Hi Richard, you are right. I meant VS6 (visual studio 6)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900