Debug Assertion in occcont.cpp Line: 926
Hi
I'm moving VC++ solution from VS 6 to VS 2005.
When application tries to load dialog with ocxes, follow error appears (on CDialog::DoModal() call):
Debug Assertion Failed!
Program: j:\nd_d\bin\are\AR_Pam.exe
File: f:\sp\vctools\vc7libs\ship\atlmfc\src\mfc\occcont.cpp
Line: 926
For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.
(Press Retry to debug the application)
Even if I try to place only one activex (e.g. some microsoft's one) onto dialog, error appears.
Some other projects from solution working ok but i can't find out what can cause such difference.
I'm using VS2005 SP1. AfxEnableControlContainer is called from CWinApp InitInstance
Please advice.
Thanks
Re: Debug Assertion in occcont.cpp Line: 926
Well, do what this "Assertion failed..." dialog recommends yo to:
Press Retry to debug the application, step into the source code and see the code/comments at the Line: 926 and some lines above it.
Re: Debug Assertion in occcont.cpp Line: 926
Thank you, Victor.
I've reviewed occcont.cpp and found that
HWND hwndCtrl=AfxGetDlgItemStartFromHWND(pOccDlgInfo->m_pItemInfo[i].nId, hwndSearchFrom);
returns 0.
There is comment also:
//If not found, revert to prev method of GetDlgItem, this means Win32 children list and resource item array are out of sync
But I don't understand what should I do to fix this 'out of sync'.
Does it mean *.rc file should store controls in same order as resource.h ?
Re: Debug Assertion in occcont.cpp Line: 926
Sorry, I don't know the reason: perhaps, something is wrong with one or more OCX controls in your VS2005 build?
And no, .rc file does NOT need to store controls in same order as resource.h (except in some rare cases as radio buttons in the group)
Re: Debug Assertion in occcont.cpp Line: 926
OCX'es are Ok. They are working in other project.
Generally it looks like problem is in some other place then in FillListSitesOrWnds (occcont.cpp).
Ocx are just not created:
GetWindow(..,GW_HWNDNEXT) 'jumps' over them.
Re: Debug Assertion in occcont.cpp Line: 926
I've dug deeper and found that error caused by OleInitialize fail (OleInitialize returned scode = RPC_E_CHANGED_MODE).
I've tried to find out where COINIT_MULTITHREADED model is set but can't find this place.
Can anybody advice how can it be set if nobody calls CoInitializeEx?
Re: Debug Assertion in occcont.cpp Line: 926
Hi Guys!
I'v the same problem, and I can't debug my application, does anyone kwon a kind of solution?
In msdn network I found that article:
http://support.microsoft.com/kb/949107
But I don't understand the real problem that mak ethe assertion... is only an ocx control unregisterd?
Best Regards
Franco Tampieri
Re: Debug Assertion in occcont.cpp Line: 926
Quote:
Originally Posted by
dr.dran
No, not "unregisterd". I seems to be "not registered"! From this article:
Quote:
This problem can occur when the ActiveX controls are not properly registered on the deployment machine.
So the first thing you should do is
Quote:
Resolution
Register ActiveX controls using regsvr32.exe.
Re: Debug Assertion in occcont.cpp Line: 926
Franco walter melon, you should stop messing your stupid ideas around. Stimulate Gal-spot, beating around the bush instead of the main one, you don't see your lack of debug and sourly bad-looking face of the GUI after all ? I only see your mouth and tongue all over one or two places to lick the secreted fluid of the debugg machine :D
Re: Debug Assertion in occcont.cpp Line: 926
It is not stupid, it is a problem with register, I am glad you see the online strategies :D
Re: Debug Assertion in occcont.cpp Line: 926
Hi guys!
I'm of the same idea of yuenqi.
@ Thu! Please don't bugging or trolling me, but suggest me a solution :P :D
I'm new of the vc++ studiointerface debug, can you suggest me if there is a function to show me the ocx dependencies or whatelse?
@VictorN I tryed to registe alla the ocx present in the program, but the result si the same, I can compile the program, but i can't debug it... grr very nasty!
Cheers
Franco
Re: Debug Assertion in occcont.cpp Line: 926
Quote:
Originally Posted by
dr.dran
@VictorN I tryed to registe alla the ocx present in the program, but the result si the same, I can compile the program, but i can't debug it... grr very nasty!
Sorry! I avoid using third party ActiveX controls since the last at least six years. So I don't have any experience with solving such "register"-problems. :sick:
Re: Debug Assertion in occcont.cpp Line: 926
Hi at all!
I found that the assert error is on that line:
{ return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID,
pPersist, bStorage, bstrLicKey); }
in the file msflexgrid.h
Anyone have experience on it?
Best regards
Franco
Re: Debug Assertion in occcont.cpp Line: 926
Quote:
Originally Posted by
dr.dran
Hi at all!
I found that the assert error is on that line:
{ return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID,
pPersist, bStorage, bstrLicKey); }
in the file msflexgrid.h
But you wrote in your OP it was in occcont.cpp:
Quote:
Originally Posted by
starcevas
Hi
I'm moving VC++ solution from VS 6 to VS 2005.
When application tries to load dialog with ocxes, follow error appears (on CDialog::DoModal() call):
Debug Assertion Failed!
Program: j:\nd_d\bin\are\AR_Pam.exe
File: f:\sp\vctools\vc7libs\ship\atlmfc\src\mfc\occcont.cpp
Line: 926
For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.
(Press Retry to debug the application)
So WHERE is the ASSERT statement that failed? What is the statement asserted? What are any comments around this ASSERT?
What does the GetClsid() return?
What are the values of other parameters passed in CreateControl?
Re: Debug Assertion in occcont.cpp Line: 926
Hi Victorn!
Well, I try do debug and isolate the problem in the code, and I place some brakepoint to block the program before the assertion.
If I run that string then the debugger give me the message in object in this forum.
I found that the parameters bstrLicKey that was a BSTR return me a bad pointer, but before is initialized to null...
this i s the string before used to give a default parameter to the funciont...
BOOL Create(LPCTSTR lpszWindowName, DWORD dwStyle,
const RECT& rect, CWnd* pParentWnd, UINT nID,
CFile* pPersist = NULL, BOOL bStorage = FALSE,
BSTR bstrLicKey = NULL)
The joke is that if I compile for release the program compile wiwhout an error... grrrrrr
Best Regards
Franco