Michael Bray <mb************ *****@you.figur e.it.out.comwro te in
news:Xn******** *************** ****@207.46.248 .16:
I'm trying to display an image on an ATL Dialog form in VS2003... I
think I am able to load an image (a GIF) w/ CImage.Load, and I'm
trying to call the SetBitmap followed by Invalidate on the CStatic
that I get, but no image appears... I'm doing this in
OnInitDialog(.. .). any help?
Hmmm I just realized something that might change what I said above...
the .SetBitmap function is actually defined in a set of headers that I
got off the internet somewhere... basically what it ends up doing is a
SendMessage with STM_SETIMAGE:
HBITMAP SetBitmap(HBITM AP hBitmap)
{
ATLASSERT(::IsW indow(m_hWnd));
return (HBITMAP)::Send Message(m_hWnd, STM_SETIMAGE, IMAGE_BITMAP,
(LPARAM)hBitmap );
}
my code:
CImage img;
LPCTSTR ctiLogo = L"c:\\\\coleman _logo.gif";
if (img.Load(ctiLo go) == S_OK)
{
ATLControls::CS tatic pic = GetDlgItem(IDC_ CTI_LOGO);
pic.SetBitmap(i mg);
pic.Invalidate( );
}
Still not working, of course, but I figured a lot of you might say "what
is SetBitmap??"
-mdb