m_hVxD = CreateFile( "\\\\.\\CommHook.vxd",
   0, 0, NULL, 0,
   FILE_FLAG_DELETE_ON_CLOSE, NULL );
为什么打不开指定的文件。

解决方案 »

  1.   

    FILE_FLAG_DELETE_ON_CLOSE   Indicates that the operating system is to delete the file immediately after all of its handles have been closed, not just the handle for which you specified FILE_FLAG_DELETE_ON_CLOSE. 
    Subsequent open requests for the file will fail, unless FILE_SHARE_DELETE is used.
     
      

  2.   

    倒数第3个参数不能为0吧
    dwCreationDisposition Long,下述常数之一:   CREATE_NEW 创建文件;如文件存在则会出错   CREATE_ALWAYS 创建文件,会改写前一个文件   OPEN_EXISTING 文件必须已经存在。由设备提出要求   OPEN_ALWAYS 如文件不存在则创建它