Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Help! Where's this assertion?

Help! Where's this assertion?

Scheduled Pinned Locked Moved C / C++ / MFC
helpdebuggingquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Daniel1324
    wrote on last edited by
    #1

    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

    P 1 Reply Last reply
    0
    • D Daniel1324

      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

      P Offline
      P Offline
      PJ Arends
      wrote on last edited by
      #2

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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups