这可能是因为你前面的代码中少掉“}”,或者没有包含头文件“stdafx.h"

解决方案 »

  1.   

    LRESULT CAllBACK 不认识,少*.h
      

  2.   

    整段放上来,先谢:
    #include "stdafx.h"LRESULT CAllBACK WindowFunc* (HWND,UINT,WPARAM,LPARAM);
    char szwinName[]="mywin";int APIENTRY WinMain(HINSTANCE hThisInst,
                         HINSTANCE hPrevInst,
                         LPSTR     lpszArgs,
                         int       nWinMode)
    {
      // TODO: Place code here.
        HWND hwnd;
    MSG msg;
        WNDCLASS wel;
    wel.hInstance=hThisInst;
    wel.lpszClassName=szwinName;
    wel.lpfnWndProc=WindowFunc;
    wel.style=0;
    wel.hIcon=LoadIcon(NULL,IDI_APPLICATION);
    wel.hCursor=LoadCursor(NULL,IDC_ARROW);
    wel.lpszMenuName=NULL;
    wel.cbClsExtra=0;
    wel.cbWndExtra=0;

    if(!RegisterClass(&wel))return 0;
    hwnd=CreateWindow(szWinName,
      "Windows 95 skeleton",
      WS_OVERLAPPEDWINDOW,
      CW_USEDEFAULT,
      CW_USEDEFAULT,
      CW_USEDEFAULT,
      CW_USEDEFAULT,
      HWND_DESKTOP,
      NULL,
      hThisInst,
      NULL);
    ShowWindow(hwnd,nWinMode);
    Update window(hwnd);
    while (GetMessage(&msg,NULL,0,0))
    {
    TranslateMessage(&msg);
    DispatchMessage(&msg);
    }
    return msg.wParam;}LRESULT CALLBACK WindowFunc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam)
    {
    switch(message)
    {
    case WM_DESTROY:
    PostQuitMessage(0);
    break;
    default:
    return DefWindowProc(hwnd,message,wParam,lParam);
    }
    return 0;
    }
      

  3.   

    Change the following sentence
    LRESULT CAllBACK WindowFunc* (HWND,UINT,WPARAM,LPARAM)to 
    LRESULT CAllBACK WindowFunc(HWND,UINT,WPARAM,LPARAM)
      

  4.   

    错误:
    Compiling...
    Hi_Two.cpp
    D:\Microsoft Visual Studio\MyProjects\Hi_Two\Hi_Two.cpp(6) : error C2146: syntax error : missing ';' before identifier 'WindowFunc'
    D:\Microsoft Visual Studio\MyProjects\Hi_Two\Hi_Two.cpp(6) : fatal error C1004: unexpected end of file found
    Error executing cl.exe.Hi_Two.exe - 2 error(s), 0 warning(s)