Dear ladies and gentlemen,
I am interesting in Computer Graphics programming with VC. I found a
piece of code segment in a book, the code is in the following:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CDC *pDC = GetDC();
if (! pDC->GetDeviceCaps(RASTERCAPS) & RC_PALETTE)
{
AfxMessageBox("Current system doesn't support Palette.");
return;
}
CString str;
int nColorNum = pDC->GetDeviceCaps(SIZEPALETTE);
str.Format("Current system palette could simultaneously display a number of
colors is %d.", nColorNum);
AfxMessageBox(str);
int nColorReserved = pDC->GetDeviceCaps(NUMRESERVED);
str.Format("The reserved color count of the current system palette is %d.",
nColorReserved);
AfxMessageBox(str);
ReleaseDC(pDC);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I created a MFC project with VC in the Visual Studio .NET 2003 . When I
compile this code above, the compiler gives me the following error code:
error C2660: ¡°GetDC¡± : Function doesn't accept 0 parameters.
How can I compile this code successfully? Help me, please.
By the way, where can I find a newsgroup specialized for the Computer
Graphics Development with VC++ .NET?
Thank you very much.
Best regards.
Xiaoming