R
RS
I have started a new MFC DLL project with the " using namespace Gdiplus; "
library and I have one routine that will compile everything except one line. The
compiled code is:
VOID OCRScreen(HWND ghwndApp)
{
BitmapData data;
HDC hdcSrc;
HDC hdcDst;
RECT rc;
HBITMAP hbm;
int x, y;
GetClientRect(ghwndApp, &rc);
x = BOUND(gptZoom.x, gcxZoomed / 2, gcxScreenMax - (gcxZoomed / 2));
y = BOUND(gptZoom.y, gcyZoomed / 2, gcyScreenMax - (gcyZoomed / 2));
rc.left = x - gcxZoomed / 2;
rc.top = y - gcyZoomed / 2;
rc.right = rc.left + gcxZoomed;
rc.bottom = rc.top + gcyZoomed;
InflateRect(&rc, 1, 1);
if (hdcSrc = GetDC(NULL))
{
if (hbm = CreateCompatibleBitmap(hdcSrc,
rc.right - rc.left, rc.bottom - rc.top))
{
if (hdcDst = CreateCompatibleDC(hdcSrc))
{
SelectObject(hdcDst, hbm);
BitBlt(hdcDst, 0, 0, rc.right - rc.left, rc.bottom - rc.top,
hdcSrc, rc.left, rc.top, SRCCOPY);
/////******** bmImage1 = new Bitmap(hbm, ghpalPhysical); ********/////
Rect rc(0, 0, bmImage1->GetWidth(), bmImage1->GetHeight());
bmImage1->LockBits(&rc, ImageLockModeWrite | ImageLockModeRead,
PixelFormat24bppRGB, &data);
// blah blah
bmImage1->UnlockBits(&data);
delete bmImage1;
DeleteDC(hdcDst);
}
DeleteObject(hbm);
}
ReleaseDC(ghwndApp, hdcSrc);
}
}// OCRScreen
The erroneous line of code that will not compile has been commented out and gives
the error C2660: 'Gdiplus::GdiplusBase:perator new' : function does not take
3 parameters. Why does Vc7 see 3 parameters as opposed to the obvious 2
parameters ?
Please help and TIA --- RS.
library and I have one routine that will compile everything except one line. The
compiled code is:
VOID OCRScreen(HWND ghwndApp)
{
BitmapData data;
HDC hdcSrc;
HDC hdcDst;
RECT rc;
HBITMAP hbm;
int x, y;
GetClientRect(ghwndApp, &rc);
x = BOUND(gptZoom.x, gcxZoomed / 2, gcxScreenMax - (gcxZoomed / 2));
y = BOUND(gptZoom.y, gcyZoomed / 2, gcyScreenMax - (gcyZoomed / 2));
rc.left = x - gcxZoomed / 2;
rc.top = y - gcyZoomed / 2;
rc.right = rc.left + gcxZoomed;
rc.bottom = rc.top + gcyZoomed;
InflateRect(&rc, 1, 1);
if (hdcSrc = GetDC(NULL))
{
if (hbm = CreateCompatibleBitmap(hdcSrc,
rc.right - rc.left, rc.bottom - rc.top))
{
if (hdcDst = CreateCompatibleDC(hdcSrc))
{
SelectObject(hdcDst, hbm);
BitBlt(hdcDst, 0, 0, rc.right - rc.left, rc.bottom - rc.top,
hdcSrc, rc.left, rc.top, SRCCOPY);
/////******** bmImage1 = new Bitmap(hbm, ghpalPhysical); ********/////
Rect rc(0, 0, bmImage1->GetWidth(), bmImage1->GetHeight());
bmImage1->LockBits(&rc, ImageLockModeWrite | ImageLockModeRead,
PixelFormat24bppRGB, &data);
// blah blah
bmImage1->UnlockBits(&data);
delete bmImage1;
DeleteDC(hdcDst);
}
DeleteObject(hbm);
}
ReleaseDC(ghwndApp, hdcSrc);
}
}// OCRScreen
The erroneous line of code that will not compile has been commented out and gives
the error C2660: 'Gdiplus::GdiplusBase:perator new' : function does not take
3 parameters. Why does Vc7 see 3 parameters as opposed to the obvious 2
parameters ?
Please help and TIA --- RS.