Help! Where's this assertion?
-
Here's the code...
void CProgramView::OnGotoButton(CString Param) { int ndex; CString Str, Url; if (Param.IsEmpty()) { ndex = m_ListBox.GetCurSel(); if (ndex == LB_ERR) { MessageBox("No Selection", "Program", MB_OK|MB_ICONERROR); return; } m_ListBox.GetText(ndex, Str); Url = ProgramUrl + Str.Left(10); } else Url = Param; ShellExecute(NULL, "open", Url, NULL, NULL, SW_SHOW); }
And here is the assertion error... Debug Assertion Failed Program: ...\Program.exe File: dbgheap.c Line: 1044 Expression: _CrtIsValidHeapPointer(pUserData) For information on how your program can cause an assertion... blah, blah, blah. ShellExecute works... the assertion happens after IE is opened. I have no idea what's causing this. Thanks! Daniel -
Here's the code...
void CProgramView::OnGotoButton(CString Param) { int ndex; CString Str, Url; if (Param.IsEmpty()) { ndex = m_ListBox.GetCurSel(); if (ndex == LB_ERR) { MessageBox("No Selection", "Program", MB_OK|MB_ICONERROR); return; } m_ListBox.GetText(ndex, Str); Url = ProgramUrl + Str.Left(10); } else Url = Param; ShellExecute(NULL, "open", Url, NULL, NULL, SW_SHOW); }
And here is the assertion error... Debug Assertion Failed Program: ...\Program.exe File: dbgheap.c Line: 1044 Expression: _CrtIsValidHeapPointer(pUserData) For information on how your program can cause an assertion... blah, blah, blah. ShellExecute works... the assertion happens after IE is opened. I have no idea what's causing this. Thanks! DanielCopied from dbgheap.c starting at line 1039:
/*
* If this ASSERT fails, a bad pointer has been passed in. It may be
* totally bogus, or it may have been allocated from another heap.
* The pointer MUST come from the 'local' heap.
*/
_ASSERTE(_CrtIsValidHeapPointer(pUserData));Are you trying to delete a pointer that was never assigned with
new
, or trying to delete it twice? or maybe the pointer was assigned in a DLL and you are trying to delete it in you app? Try to do a stack trace and see where in your code the error occured. (Alt-F7 in VC6, Ctrl-Alt-C in VC7)
[
](http://www.canucks.com)"You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04 Within you lies the power for good - Use it!