Hello,
In VB6, I have a certain function that draws a 'tileset' to a picturebox. The function is from a self-written API in C++. This is how it is written in VB6;
The code works. Now I declared it like this in VB.NET;
I'm 100% certain all parameters are correct; except for the hdc one. I simply tried "Picturebox.Han dle", and even "GetDC(Pictureb ox.Handle)" (declared GetDC from user32.dll), but it's not working.
Does anyone know if there's a difference in VB.NET that I don't know about which can cause this?
Thanks.
In VB6, I have a certain function that draws a 'tileset' to a picturebox. The function is from a self-written API in C++. This is how it is written in VB6;
Code:
Private Declare Function GFXdrawTileset Lib "actkrt3.dll" ( _
ByVal file As String, _
ByVal hdc As IntPtr, _
ByVal startIdx As Integer, _
ByVal pxWidth As Integer, _
ByVal pxHeight As Integer, _
ByVal isometric As Boolean) As Long
Code:
<DllImport("C:\Program Files\Toolkit3\actkrt3.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
Private Shared Function GFXdrawTileset( _
ByVal file As String, _
ByVal hdc As IntPtr, _
ByVal startIdx As Integer, _
ByVal pxWidth As Integer, _
ByVal pxHeight As Integer, _
<MarshalAs(UnmanagedType.Bool)> ByVal isometric As Boolean) As Integer
End Function
Does anyone know if there's a difference in VB.NET that I don't know about which can cause this?
Thanks.
Comment