Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

show Image with CImage - Debug assertion failed

89 views
Skip to first unread message

Manuel Hoeger

unread,
Feb 16, 2010, 3:55:17 PM2/16/10
to
Hi,

I tried to show a png Image using CImage ( Visual Studio 2008 prof )

It works pretty good, but only in Release Mode. If I run it in Debug Mode
there is a Message:

"Debug Assertion Failed!
Program: ....[..]\application.exe
File: g:[...]\atlimage.h
Line: 503

Expression: m_hbitmap == 0
[..]


if I ignore the message the picture is schown. How can I avoid this Failure

My Code:

BOOL OK;
LPCTSTR lpBitSource=_T("D:\\Daten\\Visual Studio
2008\\Projects\\LitLaunchTestbox\\LitLaunch\\brett1.png");
CRect rect;
GetClientRect(&rect);

CWindowDC pDC(this);
CDC dc;
OK=m_Image.Load(lpBitSource);
dc.CreateCompatibleDC(&pDC);

m_Image.Draw(pDC.m_hDC,CRect(&rect));

Thanks for answers.

Manu




0 new messages