这个提示错误,如何解决

DM 2011-06-17 03:16:59
#include "stdafx.h"
#include "resource.h"
#include <windows.h>
#include <stdio.h>
#include <shellapi.h>
#include <commctrl.h>
#pragma comment(lib, "comctl32")

BOOL CALLBACK MyProc(HWND, UINT, WPARAM, LPARAM);

int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
InitCommonControls();
DialogBox(hInstance, MAKEINTRESOURCE(IDD_ABOUTBOX), NULL, MyProc);

return 0;
}

BOOL CALLBACK MyProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
int id = LOWORD(wParam);

switch(uMsg)
{
case WM_COMMAND:
switch(id)
{


case IDC_DEL:
DeleteFile( "D:\\fififififi ");

break;


错误提示是:
--------------------Configuration: 文件夹删除 - Win32 Debug--------------------
Compiling resources...
Compiling...
StdAfx.cpp
Compiling...
文件夹删除.cpp
D:\C#\文件夹删除\文件夹删除.cpp(37) : fatal error C1004: unexpected end of file found
执行 cl.exe 时出错.

文件夹删除.exe - 1 error(s), 0 warning(s)


如何解决呢?
...全文
94 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
aprial2013 2011-06-18
  • 打赏
  • 举报
回复
你下面这段函数, 是不是应该写完整。 函数都少括号, 语法不对。
BOOL CALLBACK MyProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
int id = LOWORD(wParam);

switch(uMsg)
{
case WM_COMMAND:
switch(id)
{


case IDC_DEL:
DeleteFile( "D:\\fififififi ");

break;
xspace_time 2011-06-18
  • 打赏
  • 举报
回复
把代码复制粘贴到记事本里,不要#include "stdafx.h"
改为.cpp,重新打开编译,就可以运行了
lixing01 2011-06-18
  • 打赏
  • 举报
回复
嗯,修改了,不过还是有错误
提示是:

--------------------Configuration: 文件夹删除 - Win32 Debug--------------------
Compiling...
文件夹删除.cpp
D:\C#\文件夹删除\文件夹删除.cpp(14) : error C2373: 'DeleteFileA' : redefinition; different type modifiers
d:\c#\vc98\include\winbase.h(5509) : see declaration of 'DeleteFileA'
执行 cl.exe 时出错.


提示已经在清楚不过地告诉你了,DeleteFileA已经在winbase.h中定义了,而你又在自己的cpp文件中定了该函数,重复定义,redefinition.

看不懂,至少可以装个金山词霸,否则...
DM 2011-06-17
  • 打赏
  • 举报
回复
嗯,修改了,不过还是有错误
提示是:

--------------------Configuration: 文件夹删除 - Win32 Debug--------------------
Compiling...
文件夹删除.cpp
D:\C#\文件夹删除\文件夹删除.cpp(14) : error C2373: 'DeleteFileA' : redefinition; different type modifiers
d:\c#\vc98\include\winbase.h(5509) : see declaration of 'DeleteFileA'
执行 cl.exe 时出错.

文件夹删除.exe - 1 error(s), 0 warning(s)
c_losed 2011-06-17
  • 打赏
  • 举报
回复
有可能可能是类和结构定义的右括号 "} "后少了;
或者是少}
c_losed 2011-06-17
  • 打赏
  • 举报
回复

BOOL CALLBACK MyProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
int id = LOWORD(wParam);

switch(uMsg)
{
case WM_COMMAND:
switch(id)
{


case IDC_DEL:
DeleteFile( "D:\\fififififi ");

break;
}
}
}

69,372

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧