#include 'stdafx.h' //注意,这个向导产生的头文件不能去掉 #include <windows.h>
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ; int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,                    PSTR szCmdLine, int iCmdShow){     static TCHAR szAppName[] = TEXT ("HelloWin") ;
………………
     TranslateMessage (&msg) ;          DispatchMessage (&msg) ;     }     return msg.wParam ;}出现错误提示:
--------------------Configuration: hello - Win32 Debug--------------------
Compiling...
Cpp3.cpp
g:\myvc\temp\1\hello\cpp3.cpp(1) : error C2015: too many characters in constant
g:\myvc\temp\1\hello\cpp3.cpp(1) : error C2006: #include expected a filename, found 'constant'
Error executing cl.exe.Cpp3.obj - 2 error(s), 0 warning(s)
这是怎么回事,要怎样才能通过编译?谢谢

解决方案 »

  1.   

    #include 'stdafx.h' //注意,这个向导产生的头文件不能去掉 
    改成这样:#include <stdafx.h> 另外看下面:
         static TCHAR szAppName[] = TEXT ("HelloWin") ;
    ………………
         TranslateMessage (&msg) ;
    中间的东西是怎么多出来的?删除掉。
      

  2.   

    不知是不是手误
    #include 'stdafx.h'  错
             ~~~~~~~~~~
    #include "stdafx.h"  对
             ~~~~~~~~~~
      

  3.   

    #include "stdafx.h"当前工程目录下要有stdafx.h这个文件另外………………删掉
      

  4.   

    #include 'stdafx.h'改为#include "stdafx.h"