English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

int __stdcall WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int iCmdShow)
{

HDC hDC = GetDC(NULL);

InitializeArray();

while( !(GetAsyncKeyState(VK_ESCAPE) & 0x8000))
{

for(int x = 1; x < ARRAY_X - 1; x++)
{
for(int y = 1; y < ARRAY_Y - 1; y++)
{
int n = CheckNeighbours(x, y);

if(n == 3 && iCells[x][y] == DEAD)
iTempArray[x][y] = ALIVE;
else if( (n == 2 || n == 3) && iCells[x][y] == ALIVE)
iTempArray[x][y] = ALIVE;
else
iTempArray[x][y] = DEAD;
}
}

memcpy(iCells, iTempArray, sizeof(int) * ARRAY_X * ARRAY_Y);

for(x = 1; x < ARRAY_X - 1; x++)
{
for(int y = 1; y < ARRAY_Y - 1; y++)
{
if(iCells[x][y] == DEAD)
SetPixel(hDC, x, y, RGB(0, 0, 0));
else
SetPixel(hDC, x, y, RGB(0, 255, 0));
}
}

}

ReleaseDC(NULL, hDC);

return(0);
}
declaration syntax error?

2007-02-06 18:30:59 · 2 answers · asked by Romanianlanguage 2 in Computers & Internet Programming & Design

Something other than wild guesses?

2007-02-06 18:54:01 · update #1

2 answers

ReleaseDC() only takes 1 parameter, so it should be: ReleaseDC(hDC); Im not sure if GetDC(NULL) is right, I would have to look it up.

What does the error actually say, word for word? That would help.

2007-02-07 01:04:32 · answer #1 · answered by justme 7 · 0 0

Just a wild guess...

In the line: HDC hDC = GetDC(NULL);

Try replacing NULL with a null character i.e. '\0' or leave it empty

2007-02-07 02:36:40 · answer #2 · answered by Amanda H 6 · 0 1

fedest.com, questions and answers