Re: CBitmap problem
"Igor Tandetnik" <itandetnik@mvps.org> ???g???l???s?D:%23Wx1aMufGHA.2172@TK2MSFTNGP04.phx.gbl...
"Jack" <jl@knight.com> wrote in message
news:%238u$E6tfGHA.1456@TK2MSFTNGP04.phx.gbl
Could anyone out there help me fix this dorky program?
BOOL MyLoadBitmap(std::string szFilename)
{
// ASSERT(szFilename);
DeleteObject();
HBITMAP hBitmap = NULL;
hBitmap = (HBITMAP)LoadImage(NULL, (LPCSTR) szFilename.c_str(),
IMAGE_BITMAP, 0, 0,
LR_LOADFROMFILE | LR_CREATEDIBSECTION | LR_DEFAULTSIZE);
return Attach(hBitmap);
}
======================================
c:\Documents and
Settings\Jacky.ETC-JACKY\LPR2.0\LPR2.0\lpr2_0.cpp(45): error C2065:
'Attach' : undeclared identifier
You are calling a function named Attach, but you don't declare or define
it anywhere in your program.
I want to use
class CMyBitmap : public CBitmap
{
.....
};
But don't know where to start.
Thanks
Jack
c:\Documents and
Settings\Jacky.ETC-JACKY\LPR2.0\LPR2.0\lpr2_0.cpp(40): error C2660:
'DeleteObject' : function does not take 0 parameters
http://msdn.microsoft.com/library/en-us/gdi/devcons_1vsk.asp
DeleteObject takes one parameter. You are not passing any parameters to
it.
c:\Documents and
Settings\Jacky.ETC-JACKY\LPR2.0\LPR2.0\lpr2_0.cpp(20): warning C4800:
'BOOL' : forcing value to bool 'true' or 'false' (performance warning)
This warning is harmless and can be safely ignored. Though for
consistency, you might want to settle on using either BOOL or bool
throughout and avoid mixing the two.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925