I was watching a VB6 USB programming book, "the 8051 single-chip computer USB interface Visual Basic programming"
See chapter 12, obtain equipment designation code:
The original program for:
Public Declare Function CreateFile _
Lib "kernel32" _
Alias "CreateFileA" _
(ByVal lpFileName As String, _
ByVal dwDesiredAccess As Long, _
ByVal dwShareMode As Long, _
ByRef lpSecurityAttributes As Long, _
ByVal dwCreationDisposition As Long, _
ByVal dwFlagsAndAttributes As Long, _
ByVal hTemplateFile As Long) _
As Long
Execute the following effects:
Prompt memory location to access is invalid,
Then download a routine,
Dim Security As SECURITY_ATTRIBUTES
Public Declare Function CreateFile _
Lib "kernel32" _
Alias "CreateFileA" _
(ByVal lpFileName As String, _
ByVal dwDesiredAccess As Long, _
ByVal dwShareMode As Long, _
ByRef lpSecurityAttributes As SECURITY_ATTRIBUTES, _
ByVal dwCreationDisposition As Long, _
ByVal dwFlagsAndAttributes As Long, _
ByVal hTemplateFile As Long) _
As Long
Implementation effect is shown in figure:
Why is this so? Please directly, thank you!