见鬼,见鬼~~~~~请大家帮忙来看看~ CloseHandle的参数是HANDLE,不是你的文件名 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 CreateFile(....,OPEN_EXISTING,....)不就是用来打开文件句柄的吗? 不是吧?MSDN是这样的:那最后一个参数才是HANDLE呀,可以那个我是NULL。HANDLE CreateFile( LPCTSTR lpFileName, // pointer to name of the file DWORD dwDesiredAccess, // access (read-write) mode DWORD dwShareMode, // share mode LPSECURITY_ATTRIBUTES lpSecurityAttributes, // pointer to security attributes DWORD dwCreationDisposition, // how to create DWORD dwFlagsAndAttributes, // file attributes HANDLE hTemplateFile // handle to file with attributes to // copy); if ((hFile = CreateFile(szFileName,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL))==INVALID_HANDLE_VALUE) MessageBox(NULL,"请先选择一个有效的文件。",TEXT("出错啦!!"),0); else{CloseHandle(hFile);} warning C4047: '=' : 'void *' differs in levels of indirection from 'int ' 关于msg结构的问题 求助 今天无聊下拉个呼出外挂的程序但是有点小问题 关于使用xtreme tookKit pro 8.7编程的问题 WM_MOUSELEAVE msdn里咋没有? 问个简单的问题,在窗口中,系统给窗口和客户区是不是各分配了一个HDC句柄的?他们是不是Compatiable的? 如何获得位图的调色板(在线等,急!) 怎么做圆形的按钮?还有控制声音的三角形滑块? 一个写文件的问题 一个综合多种技术的难题,不管你会那部分都一定是高手!! ping.c 的调试错误 如何获得.doc文件中可能存在的标题和目录(29日18:00前结账)
HANDLE CreateFile(
LPCTSTR lpFileName, // pointer to name of the file
DWORD dwDesiredAccess, // access (read-write) mode
DWORD dwShareMode, // share mode
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
// pointer to security attributes
DWORD dwCreationDisposition, // how to create
DWORD dwFlagsAndAttributes, // file attributes
HANDLE hTemplateFile // handle to file with attributes to
// copy
);
MessageBox(NULL,"请先选择一个有效的文件。",TEXT("出错啦!!"),0);
else{CloseHandle(hFile);}