预计标识符或东西吗? [英] Expected identifier or something?
本文介绍了预计标识符或东西吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经输入code在DEV C ++,这是一个更新版本,奥威尔以下任一公布。这给了我一些错误,我想请你帮我跟他们:)大多数错误已经被修正了我,但他们中的一些我无法解释。我只是试图做简单的MS应用程序。
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:
第53行 [错误]预计标识符或'('前'{'标记的
在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));
}
新年快乐,和它的code好吗休息吗?
Happy new year, and it's the rest of the code okay?
推荐答案
删除分号;
在
LRESULT CALLBACK WndProc(HWND, UINT message, WPARAM wParam, LPARAM lparam);
编辑的清晰度。
您必须在看起来像下面开始的宣言
You have a declaration at the beginning that looks like the following
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM); // <-- OK
后来你有实际功能
Later you have the actual function
LRESULT CALLBACK WndProc(HWND, UINT message, WPARAM wParam, LPARAM lparam); // <--Error. Delete ';'
{ ("**this is line 53**")
:
}
这篇关于预计标识符或东西吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文