【发布时间】:2011-12-20 09:01:30
【问题描述】:
为什么 createfile() 函数会返回 -1。
Handle = CreateFile(filename, &H80000000, 0, 0, 3, &H80, 0)
这运行了几次。我在想也许文件没有正确关闭?
编辑
Err.LastllError 返回 32。
【问题讨论】:
-
GetLastError()返回什么? -
用 MSDN 团队的话来说:
If the function fails, the return value is INVALID_HANDLE_VALUE (-1). To get extended error information, call GetLastError. -
抱歉,对于 VB6 中的
GetLastError,您应该使用Err.LastDLLError,因为它可能会被以后的调用覆盖。
标签: vb6 filehandle createfile window-handles