Click to See Complete Forum and Search --> : SetPixel()
Steve
March 28th, 1999, 01:52 PM
Does anyone know why SetPixel and SetPixelV would fail if the return value of pDC>GetDeviceCaps(RASTERCAPS) contains the RC_BITBLT flag?
Does the documentation not disclose other requirements for this function to work?
Alvaro
March 28th, 1999, 02:00 PM
What does GetLastError() return?
Steve
March 28th, 1999, 02:21 PM
Is this the correct use of the GetLastError() function?
UINT32 error;
if (!pDC->SetPixelV(iX, iY, RGB(0, 255, 0)))
{
error = GetLastError();
}
I got a return value of 0. I checked the GetLastError() table and this is what zero means:
0 The operation completed successfully. ERROR_SUCCESS
Any ideas?
Thanks
Alvaro
March 28th, 1999, 02:32 PM
It looks like you're calling it correctly, assuming that "UINT32" is equivalent to DWORD.
According to the docs, if SetPixelV fails GetLastError will give you the error, but only if you're running on Windows NT. Are running on NT?
Steve
March 28th, 1999, 03:06 PM
No, I've got Win98.
I think I found a problem which is causing all my minor ones. These problems all have to do with printing documents. I've just discovered that the printing process and the screen drawing process can occur at the same time on different threads. Since both sets of functions first initialize a set of common variables, this isn't a good thing to have happen!
For example, both initialize a structure to contain the horz and vert resolution. My document is many pages in length. Sometimes between pages, that structure would suddenly change it's value!
Things seem to be working a lot better now.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.