CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 22

Thread: Debug Assertion in occcont.cpp Line: 926

  1. #1
    Join Date
    Jun 2008
    Posts
    5

    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:oModal() 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

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,732

    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.
    Victor Nijegorodov

  3. #3
    Join Date
    Jun 2008
    Posts
    5

    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 ?

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,732

    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)
    Victor Nijegorodov

  5. #5
    Join Date
    Jun 2008
    Posts
    5

    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.
    Last edited by starcevas; June 3rd, 2008 at 07:15 AM.

  6. #6
    Join Date
    Jun 2008
    Posts
    5

    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?

  7. #7
    Join Date
    Feb 2009
    Posts
    5

    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

  8. #8
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,732

    Re: Debug Assertion in occcont.cpp Line: 926

    Quote Originally Posted by dr.dran View Post
    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?
    No, not "unregisterd". I seems to be "not registered"! From this article:
    This problem can occur when the ActiveX controls are not properly registered on the deployment machine.
    So the first thing you should do is
    Resolution
    Register ActiveX controls using regsvr32.exe.
    Victor Nijegorodov

  9. #9
    Join Date
    Nov 2007
    Posts
    74

    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

  10. #10
    Join Date
    Feb 2009
    Posts
    56

    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

  11. #11
    Join Date
    Feb 2009
    Posts
    5

    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
    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

  12. #12
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,732

    Re: Debug Assertion in occcont.cpp Line: 926

    Quote Originally Posted by dr.dran View Post
    @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.
    Victor Nijegorodov

  13. #13
    Join Date
    Feb 2009
    Posts
    5

    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

  14. #14
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,732

    Re: Debug Assertion in occcont.cpp Line: 926

    Quote Originally Posted by dr.dran View Post
    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 View Post
    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:oModal() 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?
    Victor Nijegorodov

  15. #15
    Join Date
    Feb 2009
    Posts
    5

    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

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)