delphi7写的一个, winxp里一切正常, win7报错
在winxp写的, 测试也没任何问题, 到win7机子里一用就报错, 程序是hook了其他程序在使用, 请问这个问题是哪方面的问题?
弹出问题窗口,以下是信息
问题签名:
问题事件名称:APPCRASH
应用程序名:pp.exe
应用程序版本:1.0.3.3316
应用程序时间戳:2a425e19
故障模块名称:KERNELBASE.dll
故障模块版本:6.1.7601.18015
故障模块时间戳:50b83b16
异常代码:0eedfade
异常偏移:0000812f
OS 版本:6.1.7601.2.1.0.256.1
区域设置 ID:2052
其他信息 1:6e30
其他信息 2:6e3095608dc28e1175d12910025d0eb4
其他信息 3:1996
其他信息 4:1996b64324e2ca16577c7b922cb1cf28
这个窗口关闭后, 还有个对话框
显示 Exception EInOutError in module at pp.exe
file not found
[解决办法]
I/O错误,是不是用了一个DLL文件,这个文件在XP有,但WIN7没有或路径出了问题。
[解决办法]
在win7的机器上编译调试才好跟踪问题
[解决办法]
Delphi syntax:
var FileMode: Byte = 2;
Note:Be sure to reset FileMode before calling Reset with a read-only file. Even if you are only reading from the file, the default FileMode value (Read/Write access) will cause an attempt to open a read-only file to fail.
Warning:FileMode is declared as a variable, not as a threadvar. Therefore this variable is not thread-safe.
重置filemode之前必须先rest(f),否则即使你以只读方式也将导致文件打开失败。再一个filemode不是线程安全的。
另外你试试用这个方法在线程中使用是否有问题
function GetExeSize: Int64;
var
SearchRec: TSearchRec;
begin
Result := -1;
if FindFirst(Application.ExeName, faAnyFile, SearchRec) = 0 then
Result := SearchRec.Size;
end;