Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

function explanation

99 views
Skip to first unread message

Kurt Santelé

unread,
Mar 23, 1999, 3:00:00 AM3/23/99
to
Has someone an idea what the following function does :
(the function is situated in wincore.cpp)
I'm asking this because my program crashes in the marked line.
////////////////////////////////////////////////////////////////////////////
/
// Special WndProcs (activation handling & gray dialogs)

AFX_STATIC_DATA const TCHAR _afxOldWndProc[] = _T("AfxOldWndProc423");

LRESULT CALLBACK
_AfxActivationWndProc(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
{
WNDPROC oldWndProc = (WNDPROC)::GetProp(hWnd, _afxOldWndProc);
ASSERT(oldWndProc != NULL);

LRESULT lResult = 0;
TRY
{
BOOL bCallDefault = TRUE;
switch (nMsg)
{
case WM_INITDIALOG:
{
DWORD dwStyle;
CRect rectOld;
CWnd* pWnd = CWnd::FromHandle(hWnd);
_AfxPreInitDialog(pWnd, &rectOld, &dwStyle);
bCallDefault = FALSE;
lResult = CallWindowProc(oldWndProc, hWnd, nMsg, wParam, lParam);
_AfxPostInitDialog(pWnd, rectOld, dwStyle);
}
break;

case WM_ACTIVATE:
_AfxHandleActivate(CWnd::FromHandle(hWnd), wParam,
CWnd::FromHandle((HWND)lParam));
break;

case WM_SETCURSOR:
bCallDefault = !_AfxHandleSetCursor(CWnd::FromHandle(hWnd),
(short)LOWORD(lParam), HIWORD(lParam));
break;

case WM_NCDESTROY:
SetWindowLong(hWnd, GWL_WNDPROC, (DWORD)oldWndProc);
RemoveProp(hWnd, _afxOldWndProc);
GlobalDeleteAtom(GlobalFindAtom(_afxOldWndProc));
break;
}

// call original wndproc for default handling
if (bCallDefault)
lResult = CallWindowProc(oldWndProc, hWnd, nMsg, wParam, lParam);
// my app crashes here :(
// the values are : 0 =
CallWindowProc(0x00d48ca8, 0x07cb0760, 28, 0, 162);
}
CATCH_ALL(e)
{
// handle exception
MSG msg;
msg.hwnd = hWnd;
msg.message = nMsg;
msg.wParam = wParam;
msg.lParam = lParam;
lResult = AfxGetThread()->ProcessWndProcException(e, &msg);
TRACE1("Warning: Uncaught exception in _AfxActivationWndProc (returning
%ld).\n",
lResult);
DELETE_EXCEPTION(e);
}
END_CATCH_ALL

return lResult;
}

Greetings
Kurt.S...@vartec.be


Joku

unread,
Mar 23, 1999, 3:00:00 AM3/23/99
to
Kurt, when your program stops on wincore.cpp because of some assertion
doesnt mean that wincore.cpp has a problem. Try to get the callstack window
up and look for the functions that was generated / called on or by your
program. Try to look from there. The assertion that you have seen is "most
probably" caused by a line in "your own" code.

--

John Joelle Cruz
Software Engineer
Nortel Networks Inc.
[e-mail] johnc...@usa.net
[homepage] http://members.xoom.com/johncruise

Kurt Santelé <Kurt.S...@vartec.be> wrote in message
news:eByFj1Qd#GA...@cppssbbsa02.microsoft.com...

0 new messages