VB编译后没有返回正确的CreateFile

来源:百度知道 编辑:UC知道 时间:2024/06/24 07:13:51
但在VB开发环境中为何可以得出正确的值? 真是奇怪! 发现是CreateFile函数没有执行成功

If the function succeeds, the return value is an open handle to the specified file, device, named pipe, or mail slot.

If the function fails, the return value is INVALID_HANDLE_VALUE.
===========================
msdn的官方解释:

如果函数成功,返回值是一个句柄;

如果失败,返回值是INVALID_HANDLE_VALUE