我在用win32 API的函数CreateFile时出现一些问题,希望大家指教一下!在general的declarations中声明这些函数如下:
Private Declare Function CreateFile Lib "kernel32" Alias "CreateFileA" (ByVal lpFileName As String, ByVal dwDesiredAccess As Long, ByVal dwShareMode As Long, lpSecurityAttributes As SECURITY_ATTRIBUTES, ByVal dwCreationDisposition As Long, ByVal dwFlagsAndAttributes As Long, ByVal hTemplateFile As Long) As LongPrivate Declare Function ReadFile Lib "kernel32" (ByVal hFile As Long, ByVal lpBuffer As Long, ByVal nNumberOfBytesToRead As Long, lpNumberOfBytesRead As Long, ByVal lpOverlapped As Long) As Long点击运行之后,系统提示错误如下:
Compile error:
User-defined type not definedvb显亮CreateFile函数的声明但是,当我注销掉CreateFile 这个声明时就不会报错。请问这是个什么问题,同样都是kernel32中的函数,为什么ReadFile 可以使用而CreateFile 报上面的错误呢?兄弟只有20分了,全加上!