Hello,
Recently, I converted my VB6 app to VB.NET. I got the standard upgrade
messages and fixed them so now I can run my app. I have noticed, though,
that some of the library functions will not work in .NET, namely:
CreateFile
LockFile
UnlockFile
CloseHandle
declared as
Public Declare Auto Function CreateFile Lib "kernel32.d ll" Alias
"CreateFile A" (ByVal lpFileName As String, ByVal dwDesiredAccess As
Int32, ByVal dwShareMode As Int32, ByRef lpSecurityAttri butes As IntPtr,
ByVal dwCreationDispo sition As Int32, ByVal dwFlagsAndAttri butes As
Int32, ByVal hTemplateFile As IntPtr) As IntPtr
Public Declare Auto Function LockFile Lib "kernel32.d ll" (ByVal hFile
As IntPtr, ByVal dwFileOffsetLow As Int32, ByVal dwFileOffsetHig h As
Int32, ByVal nNumberOfBytesT oLockLow As Int32, ByVal
nNumberOfBytesT oLockHigh As Int32) As Int32
Public Declare Auto Function UnlockFile Lib "kernel32.d ll" (ByVal
hFile As IntPtr, ByVal dwFileOffsetLow As Int32, ByVal dwFileOffsetHig h
As Int32, ByVal nNumberOfBytesT oUnlockLow As Int32, ByVal
nNumberOfBytesT oUnlockHigh As Int32) As Int32
Public Declare Auto Function CloseHandle Lib "kernel32.d ll" (ByVal
hObject As IntPtr) As Boolean
How do I fix this problem?
Thanks,
Andrew
Recently, I converted my VB6 app to VB.NET. I got the standard upgrade
messages and fixed them so now I can run my app. I have noticed, though,
that some of the library functions will not work in .NET, namely:
CreateFile
LockFile
UnlockFile
CloseHandle
declared as
Public Declare Auto Function CreateFile Lib "kernel32.d ll" Alias
"CreateFile A" (ByVal lpFileName As String, ByVal dwDesiredAccess As
Int32, ByVal dwShareMode As Int32, ByRef lpSecurityAttri butes As IntPtr,
ByVal dwCreationDispo sition As Int32, ByVal dwFlagsAndAttri butes As
Int32, ByVal hTemplateFile As IntPtr) As IntPtr
Public Declare Auto Function LockFile Lib "kernel32.d ll" (ByVal hFile
As IntPtr, ByVal dwFileOffsetLow As Int32, ByVal dwFileOffsetHig h As
Int32, ByVal nNumberOfBytesT oLockLow As Int32, ByVal
nNumberOfBytesT oLockHigh As Int32) As Int32
Public Declare Auto Function UnlockFile Lib "kernel32.d ll" (ByVal
hFile As IntPtr, ByVal dwFileOffsetLow As Int32, ByVal dwFileOffsetHig h
As Int32, ByVal nNumberOfBytesT oUnlockLow As Int32, ByVal
nNumberOfBytesT oUnlockHigh As Int32) As Int32
Public Declare Auto Function CloseHandle Lib "kernel32.d ll" (ByVal
hObject As IntPtr) As Boolean
How do I fix this problem?
Thanks,
Andrew
Comment