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. GetAddress of IPAddress Control crashing..

GetAddress of IPAddress Control crashing..

Scheduled Pinned Locked Moved C / C++ / MFC
debugginghelptutorialquestion
3 Posts 3 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.
  • I Offline
    I Offline
    IrishSonic
    wrote on last edited by
    #1

    Hiya I have dropped an IPAddress Control from the toolbox onto my form. But when I use GetAddress() or IsBlank() methods of the IPAddress control, the program crashes with: Debug Assertion Failed! Program: File: f:\vs70builds\3077\vc\MFCATL\ship\atlmfc\include\afxcmn2.inl Line: 344 Does anyone know how to fix this?? Thanks.

    J M 2 Replies Last reply
    0
    • I IrishSonic

      Hiya I have dropped an IPAddress Control from the toolbox onto my form. But when I use GetAddress() or IsBlank() methods of the IPAddress control, the program crashes with: Debug Assertion Failed! Program: File: f:\vs70builds\3077\vc\MFCATL\ship\atlmfc\include\afxcmn2.inl Line: 344 Does anyone know how to fix this?? Thanks.

      J Offline
      J Offline
      jmkhael
      wrote on last edited by
      #2

      Seems like your dialog is closed the time u call this method Papa while (TRUE) Papa.WillLove ( Bebe ) ;

      1 Reply Last reply
      0
      • I IrishSonic

        Hiya I have dropped an IPAddress Control from the toolbox onto my form. But when I use GetAddress() or IsBlank() methods of the IPAddress control, the program crashes with: Debug Assertion Failed! Program: File: f:\vs70builds\3077\vc\MFCATL\ship\atlmfc\include\afxcmn2.inl Line: 344 Does anyone know how to fix this?? Thanks.

        M Offline
        M Offline
        Mike Dimmick
        wrote on last edited by
        #3

        Did you try running under the debugger and hitting Retry when prompted? That takes you to the line firing the assertion. Also, look in the vc7\atlmfc\include directory under Visual Studio .NET's install directory. The source line reads:

        _AFXCMN_INLINE BOOL CIPAddressCtrl::IsBlank() const
        { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, IPM_ISBLANK, 0, 0L); }

        This indicates that you tried to call it on an object whose m_hWnd member isn't a valid window handle. Usually this means that either you tried to use an object you haven't initialised (m_hWnd is NULL), that you stored a pointer returned from GetDlgItem and then later tried to use that pointer in a different message handler, or, more rarely, that some kind of memory corruption has occurred (typically through a buffer overrun). You'll also get problems passing CWnd pointers between threads, particularly if they point to temporary objects. You must not store pointers to temporary CWnd objects. Any MFC function returning a CWnd* may return a pointer to a temporary object; these temporary objects are cleaned up the next time your program is idle. If you need to reference a window for a period longer than the duration of the current function, create a CWnd-derived object and call Attach. You can use the DDX_Control function in your DoDataExchange override to automatically hook up a member variable to a control. You can do this through the Visual Studio environment by right-clicking the control in the dialog designer and choosing Add Variable. Stability. What an interesting concept. -- Chris Maunder

        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