一个编译错误问题! 超级编译错误难题!! 楼主跪求答案!!!
====================================================
问题如下:
编译错误!
C:\Documents and Settings\Administrator\桌面\InputMessage\InputMessage.cpp(34) : error C2448: '<Unknown>' : function-style initializer appears to be a function definition
C:\Documents and Settings\Administrator\桌面\InputMessage\InputMessage.cpp(34) : fatal error C1004: unexpected end of file found
执行 cl.exe 时出错.源代码================================================
#include "stdafx.h"
#include <windows.h>
dllimport("USER32.DLL")
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
INPUT kbinput;
ZeroMemory( &kbinput, sizeof(INPUT) ); kbinput.type = INPUT_KEYBOARD;
kbinput.ki.wVk = VK_LWIN; SendInput( 3, kbinput, sizeof(INPUT) );
return 0;
}
====================================================
问题如下:
编译错误!
C:\Documents and Settings\Administrator\桌面\InputMessage\InputMessage.cpp(34) : error C2448: '<Unknown>' : function-style initializer appears to be a function definition
C:\Documents and Settings\Administrator\桌面\InputMessage\InputMessage.cpp(34) : fatal error C1004: unexpected end of file found
执行 cl.exe 时出错.源代码================================================
#include "stdafx.h"
#include <windows.h>
dllimport("USER32.DLL")
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
INPUT kbinput;
ZeroMemory( &kbinput, sizeof(INPUT) ); kbinput.type = INPUT_KEYBOARD;
kbinput.ki.wVk = VK_LWIN; SendInput( 3, kbinput, sizeof(INPUT) );
return 0;
}
解决方案 »
- 咨询下,这样的图opengl能不能画出来
- 雪地跪求!!!界面显示问题 !
- 创建共享
- 请教!如何确定操作系统的版本
- 中国红客攻破KKK特大号家庭装上海的分政府网
- 请问如何让MCIWnd播放mpeg视频?
- 关于组播
- 请问加载的ActiveX控件(使用ATL)如何打开一个网页?
- 我的工程中的DLL是设置为“在共享 DLL 中使用 MFC”,“多线程 DLL (/MD)”,在发布静默安装包的问题?
- MFC应用程序,VC++中有什么控件播放Ppt,播放Pdf格式文件和flash
- 请教运行错误error C2039: 'OnAccept' : is not a member of 'CMyqqseverDlg'的原因
- 我还真就不信征服不了CXImage@#$!!!
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
INPUT kbinput;
ZeroMemory( &kbinput, sizeof(INPUT) );
kbinput.type = INPUT_KEYBOARD;
kbinput.ki.wVk = VK_LWIN;
SendInput(3, &kbinput, sizeof(INPUT) );
return 0;
} // stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//#if !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
#define AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers#define _WIN32_WINNT 0x0500#include <windows.h>
// TODO: reference additional headers your program requires here//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.#endif // !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
#pragma once
#define _WIN32_WINNT 0x0500
#include <windows.h>
// ……// InputMessage.cpp
#include "stdafx.h"
#pragma comment(lib, "user32.lib")
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
INPUT kbinput;
ZeroMemory( &kbinput, sizeof(INPUT) );
kbinput.type = INPUT_KEYBOARD;
kbinput.ki.wVk = VK_LWIN;
SendInput( 3, &kbinput, sizeof(INPUT) );
return 0;
}
加上头文件:<winable.h>