#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)
这是怎么回事,要怎样才能通过编译?谢谢
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)
这是怎么回事,要怎样才能通过编译?谢谢
解决方案 »
- VC学习
- 能否提供一个在某固定坐标点击鼠标左键的例程
- 采用哪种WINSOCK I/O模型好?
- windows服务程序如何得到当前计算机的用户名(常见问题)
- 是否我建立的项目类型错了?
- 再请高手中的高手来看看 DLL 中含 CFormView的问题,解决了这个问题把我的5000分全给你都行
- 使用InternetOpen到底要包什么头文件啊???
- 大家帮看看我的Visual Studio 6出什么问题了?
- 请教一个问题
- 关于内存设备环境的问题...............................................SOS
- 请教while(char c = cin.get()!='q') 是对是错(Thinking in c++ P146)
- 郁闷啊
改成这样:#include <stdafx.h> 另外看下面:
static TCHAR szAppName[] = TEXT ("HelloWin") ;
………………
TranslateMessage (&msg) ;
中间的东西是怎么多出来的?删除掉。
#include 'stdafx.h' 错
~~~~~~~~~~
#include "stdafx.h" 对
~~~~~~~~~~