Debug Assertion failure in AFXWIN2.inl
-
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 dialogCBitmapEdit
is a class derived from CDialog that will create a popup modal dialog boxCEditAndCapture
is the class that handles the main window and the call toCBitmapEdit
is as above. I kinda suspect is the way I'm callingCBitmapEdit
'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
-
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 dialogCBitmapEdit
is a class derived from CDialog that will create a popup modal dialog boxCEditAndCapture
is the class that handles the main window and the call toCBitmapEdit
is as above. I kinda suspect is the way I'm callingCBitmapEdit
'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
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] -
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] -
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
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]