A
Andrew Clark
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.dll" Alias
"CreateFileA" (ByVal lpFileName As String, ByVal dwDesiredAccess As
Int32, ByVal dwShareMode As Int32, ByRef lpSecurityAttributes As IntPtr,
ByVal dwCreationDisposition As Int32, ByVal dwFlagsAndAttributes As
Int32, ByVal hTemplateFile As IntPtr) As IntPtr
Public Declare Auto Function LockFile Lib "kernel32.dll" (ByVal hFile
As IntPtr, ByVal dwFileOffsetLow As Int32, ByVal dwFileOffsetHigh As
Int32, ByVal nNumberOfBytesToLockLow As Int32, ByVal
nNumberOfBytesToLockHigh As Int32) As Int32
Public Declare Auto Function UnlockFile Lib "kernel32.dll" (ByVal
hFile As IntPtr, ByVal dwFileOffsetLow As Int32, ByVal dwFileOffsetHigh
As Int32, ByVal nNumberOfBytesToUnlockLow As Int32, ByVal
nNumberOfBytesToUnlockHigh As Int32) As Int32
Public Declare Auto Function CloseHandle Lib "kernel32.dll" (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.dll" Alias
"CreateFileA" (ByVal lpFileName As String, ByVal dwDesiredAccess As
Int32, ByVal dwShareMode As Int32, ByRef lpSecurityAttributes As IntPtr,
ByVal dwCreationDisposition As Int32, ByVal dwFlagsAndAttributes As
Int32, ByVal hTemplateFile As IntPtr) As IntPtr
Public Declare Auto Function LockFile Lib "kernel32.dll" (ByVal hFile
As IntPtr, ByVal dwFileOffsetLow As Int32, ByVal dwFileOffsetHigh As
Int32, ByVal nNumberOfBytesToLockLow As Int32, ByVal
nNumberOfBytesToLockHigh As Int32) As Int32
Public Declare Auto Function UnlockFile Lib "kernel32.dll" (ByVal
hFile As IntPtr, ByVal dwFileOffsetLow As Int32, ByVal dwFileOffsetHigh
As Int32, ByVal nNumberOfBytesToUnlockLow As Int32, ByVal
nNumberOfBytesToUnlockHigh As Int32) As Int32
Public Declare Auto Function CloseHandle Lib "kernel32.dll" (ByVal
hObject As IntPtr) As Boolean
How do I fix this problem?
Thanks,
Andrew