Click here to Skip to main content
15,913,388 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: 'Notify'-> WS_NOTIFY?!? Pin
PJ Arends31-Jul-02 15:09
professionalPJ Arends31-Jul-02 15:09 
GeneralBeginner's one: Minimizing wnd message... Pin
BlackSmith31-Jul-02 13:48
BlackSmith31-Jul-02 13:48 
GeneralRe: Beginner's one: Minimizing wnd message... Pin
PJ Arends31-Jul-02 14:39
professionalPJ Arends31-Jul-02 14:39 
GeneralRe: Beginner's one: Minimizing wnd message... Pin
JohnnyG31-Jul-02 15:16
JohnnyG31-Jul-02 15:16 
Questionmfc70.dll bug? Pin
Marc Clifton31-Jul-02 13:18
mvaMarc Clifton31-Jul-02 13:18 
General102 compiling errors in commdlg.h Pin
redeemer31-Jul-02 13:00
redeemer31-Jul-02 13:00 
GeneralRe: 102 compiling errors in commdlg.h Pin
Chris Losinger31-Jul-02 13:02
professionalChris Losinger31-Jul-02 13:02 
GeneralCalling AfxMessageBox from within CDocument Class Pin
adamUK31-Jul-02 12:34
adamUK31-Jul-02 12:34 
This is probably really simple but my poor brain hurts.

I have some code that checks if it can make sense of the data loaded during serialisation in my CDocument derived class.

void CPERDoc::Serialize(CArchive& ar)<br />
{<br />
      AfxMessageBox("Data not recognisable");<br />
}

When AfxMessageBox is called, The dialog box appears and I then get 'Debug Assertion Failed at line 628 of wincore.cpp'

the relevant bit of code in wincore.cpp is this..

void AFXAPI AfxHookWindowCreate(CWnd* pWnd)<br />
{<br />
        _AFX_THREAD_STATE* pThreadState = _afxThreadState.GetData();<br />
        if (pThreadState->m_pWndInit == pWnd)<br />
                return;<br />
<br />
        if (pThreadState->m_hHookOldCbtFilter == NULL)<br />
        {<br />
                pThreadState->m_hHookOldCbtFilter = ::SetWindowsHookEx(WH_CBT,<br />
                        _AfxCbtFilterHook, NULL, ::GetCurrentThreadId());<br />
                if (pThreadState->m_hHookOldCbtFilter == NULL)<br />
                        AfxThrowMemoryException();<br />
        }<br />
        ASSERT(pThreadState->m_hHookOldCbtFilter != NULL);<br />
        ASSERT(pWnd != NULL);<br />
###     ASSERT(pWnd->m_hWnd == NULL);   // only do once<br />
<br />
        ASSERT(pThreadState->m_pWndInit == NULL);   // hook not already in progress<br />
        pThreadState->m_pWndInit = pWnd;<br />
}


During debug, the little yellow arrow stops by the three hashes.

I can work my way around it but can anybody tell me why this does not work?

It happens if I call AfxMessageBox() from anywhere in CDocument. Funnily enough GetMainWnd()->MessageBox() causes the same error if put in the CDocument Class.

Would appreciate some help! Many Thanks!! Smile | :)

Adam.

"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
GeneralRe: Calling AfxMessageBox from within CDocument Class Pin
adamUK23-Aug-02 5:18
adamUK23-Aug-02 5:18 
GeneralProblem with InsertMenu with respect to Release vs. Debug compulation Pin
Eldon Zacek31-Jul-02 11:56
Eldon Zacek31-Jul-02 11:56 
GeneralRe: Problem with InsertMenu with respect to Release vs. Debug compulation Pin
Chris Losinger31-Jul-02 13:03
professionalChris Losinger31-Jul-02 13:03 
GeneralRe: Problem with InsertMenu with respect to Release vs. Debug compulation Pin
Eldon Zacek31-Jul-02 13:16
Eldon Zacek31-Jul-02 13:16 
GeneralRe: Problem with InsertMenu with respect to Release vs. Debug compulation Pin
Eldon Zacek31-Jul-02 17:09
Eldon Zacek31-Jul-02 17:09 
GeneralCTreeCtrl checkboxes, oleaut.dll, and MSDN Pin
dazinith31-Jul-02 11:41
dazinith31-Jul-02 11:41 
GeneralRe: CTreeCtrl checkboxes, oleaut.dll, and MSDN Pin
dazinith1-Aug-02 4:34
dazinith1-Aug-02 4:34 
QuestionCWnd::OnActiveApp( ): WTF is HTASK??? Pin
BlackSmith31-Jul-02 11:31
BlackSmith31-Jul-02 11:31 
AnswerRe: CWnd::OnActiveApp( ): WTF is HTASK??? Pin
Stuart Dootson31-Jul-02 13:20
professionalStuart Dootson31-Jul-02 13:20 
GeneralAdding dialog to system info about file Pin
defox31-Jul-02 11:17
defox31-Jul-02 11:17 
GeneralDrawDragRect() help Pin
Stew31-Jul-02 11:12
Stew31-Jul-02 11:12 
GeneralStatic vs. Shared MFC in dll Pin
dartonw31-Jul-02 9:34
dartonw31-Jul-02 9:34 
GeneralRe: Static vs. Shared MFC in dll Pin
Navin31-Jul-02 9:53
Navin31-Jul-02 9:53 
GeneralRe: Static vs. Shared MFC in dll Pin
Ranjan Banerji31-Jul-02 10:45
Ranjan Banerji31-Jul-02 10:45 
GeneralAn editBox and variable CString Pin
ns31-Jul-02 9:23
ns31-Jul-02 9:23 
GeneralRe: An editBox and variable CString Pin
PJ Arends31-Jul-02 9:31
professionalPJ Arends31-Jul-02 9:31 
GeneralRe: An editBox and variable CString Pin
Ravi Bhavnani31-Jul-02 9:54
professionalRavi Bhavnani31-Jul-02 9:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.