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. Debug Assertion failure in AFXWIN2.inl

Debug Assertion failure in AFXWIN2.inl

Scheduled Pinned Locked Moved C / C++ / MFC
helpgraphicsdebuggingquestion
4 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.
  • J Offline
    J Offline
    JJeffrey
    wrote on last edited by
    #1

    I seem to have encountered a Debug Assertion failure in AFXWIN2.inl, line 572 The error happens in the following Code:

    void CBitmapEdit::PutUpImage()
    {
    HBITMAP PreEditImage = LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_BITMAP1));

    m\_EdittingImage.SetBitmap(PreEditImage)   // <--- Error occurs here
    
        DoModal();
    

    }
    .
    .
    .
    .
    .
    .
    void CEditAndCapture::OnEditbmp()
    {
    CBitmapEdit* EditImage = new CBitmapEdit;
    EditImage->PutUpImage();
    }

    m_EdittingImage is a CStatic object that will contain the Bitmap to display a dialog CBitmapEdit is a class derived from CDialog that will create a popup modal dialog box CEditAndCapture is the class that handles the main window and the call to CBitmapEdit is as above. I kinda suspect is the way I'm calling CBitmapEdit's methods, am I right? BTW, Line 572 is :

    _AFXWIN_INLINE HBITMAP CStatic::SetBitmap(HBITMAP hBitmap)
    { ASSERT(::IsWindow(m_hWnd)); return (HBITMAP)::SendMessage(m_hWnd, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hBitmap); }

    Can anyone help? Thanks. Jeffrey

    CPalliniC 1 Reply Last reply
    0
    • J JJeffrey

      I seem to have encountered a Debug Assertion failure in AFXWIN2.inl, line 572 The error happens in the following Code:

      void CBitmapEdit::PutUpImage()
      {
      HBITMAP PreEditImage = LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_BITMAP1));

      m\_EdittingImage.SetBitmap(PreEditImage)   // <--- Error occurs here
      
          DoModal();
      

      }
      .
      .
      .
      .
      .
      .
      void CEditAndCapture::OnEditbmp()
      {
      CBitmapEdit* EditImage = new CBitmapEdit;
      EditImage->PutUpImage();
      }

      m_EdittingImage is a CStatic object that will contain the Bitmap to display a dialog CBitmapEdit is a class derived from CDialog that will create a popup modal dialog box CEditAndCapture is the class that handles the main window and the call to CBitmapEdit is as above. I kinda suspect is the way I'm calling CBitmapEdit's methods, am I right? BTW, Line 572 is :

      _AFXWIN_INLINE HBITMAP CStatic::SetBitmap(HBITMAP hBitmap)
      { ASSERT(::IsWindow(m_hWnd)); return (HBITMAP)::SendMessage(m_hWnd, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hBitmap); }

      Can anyone help? Thanks. Jeffrey

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #2

      It looks like you never created the window associated with the CStatic control. :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
      [My articles]

      In testa che avete, signor di Ceprano?

      J 1 Reply Last reply
      0
      • CPalliniC CPallini

        It looks like you never created the window associated with the CStatic control. :)

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
        [My articles]

        J Offline
        J Offline
        JJeffrey
        wrote on last edited by
        #3

        Ah... I see. Cart before the horse issue... All because I was doing it in modules and didn't set up everything else yet before testing.. I'll try again... Thanks

        CPalliniC 1 Reply Last reply
        0
        • J JJeffrey

          Ah... I see. Cart before the horse issue... All because I was doing it in modules and didn't set up everything else yet before testing.. I'll try again... Thanks

          CPalliniC Offline
          CPalliniC Offline
          CPallini
          wrote on last edited by
          #4

          JJeffrey wrote:

          All because I was doing it in modules and didn't set up everything else yet before testing..

          At least you're doing test. That's a good practice. :)

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
          This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
          [My articles]

          In testa che avete, signor di Ceprano?

          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