I have typed code posted below in DEV C++, which is an updated version, the Orwell one. It gave me some errors and I would like you to help me with them :) Most of the errors are already been fixed by me, but some of them I just cant explain. I am just trying to do simple MS app program.
Compiler gives me this error:
LINE 53 [Error] expected identifier or '(' before '{' token
The code:
# include <windows.h>
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);
int WinMain (HINSTANCE hinstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
{
static TCHAR szAppName[] = TEXT ("HelloWin");
HWND hwnd;
MSG msg;
WNDCLASS wndclass;
wndclass.style = CS_HREDRAW| CS_VREDRAW;
wndclass.lpfnWndProc = WndProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = hinstance;
wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION);
wndclass.hCursor = LoadCursor (NULL, IDC_ARROW);
wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH);
wndclass.lpszMenuName = NULL;
wndclass.lpszClassName = szAppName;
if (!RegisterClass (&wndclass))
{
MessageBox (NULL, TEXT ("XXCXCXCXCX"), szAppName, MB_ICONERROR);
return (0);
}
hwnd = CreateWindow (szAppName,
TEXT("FRFRFRFRF"),
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
hinstance,
NULL);
ShowWindow (hwnd, iCmdShow);
UpdateWindow (hwnd);
while (GetMessage (&msg, NULL, 0, 0))
{
TranslateMessage (& msg);
DispatchMessage (& msg);
} /* END while*/
return (msg.wParam);
} /* END WinMain () */
LRESULT CALLBACK WndProc(HWND, UINT message, WPARAM wParam, LPARAM lparam);
{ ("**this is line 53**")
HDC hdc;
PAINTSTRUCT ps;
RECT rect;
switch (message)
{
case WM_CREATE:
PlaySound("FRFRFRZZZZZ.wav"), NULL, SND_FILENAME|SND-ASIAC
return (0);
case WM_PAINT:
hdc = BeginPaint (hwnd, &ps);
GetClientRect (hwnd, &rect);
DrawText (hdc, TEXT ("HZHZHZHZ!"), -1, &, DT_SINGLELINE|DT-CENTER|DT_VCENT;
EndPoint (hwnd, &ps);
return (0);
case WM_DESTROY;
PostQuitMessage (0);
return (0);
}
return (DefWindowProc (hwnd, message, wParam, lParam));
}
Happy new year, and it's the rest of the code okay?
See Question&Answers more detail:
os