我只是用api阅览器生命了一个api函数createfile,然后编译就总出现用户定义类型未定义的错误!为什么!

解决方案 »

  1.   

    Public 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 LongSECURITY_ATTRIBUTES需要申明Public Type SECURITY_DESCRIPTOR
            Revision As Byte
            Sbz1 As Byte
            Control As Long
            Owner As Long
            Group As Long
            Sacl As ACL
            Dacl As ACL
    End Type
      

  2.   

    不好意思,应该是这个
    Public Type SECURITY_ATTRIBUTES
            nLength As Long
            lpSecurityDescriptor As Long
            bInheritHandle As Long 
    End Type