Hello.
I'm having some trouble in trying to use functions from a C dll in VB.Net.
I try to read a char array from memory with a pointer.
This is how it is working in c++
[CODE=cpp]typedef int ( WINAPI *INRECV )(int,int*,char *,int,int*,int) ;[/CODE]
and this is what I wrote in vb.net
[CODE=vbnet]Public Class Win32
Public Declare Function inrecv Lib "INTCP32.dl l" (ByVal i As Integer, ByRef j As Integer, ByRef s As IntPtr, ByVal k As Integer, ByRef l As Integer, ByVal m As Integer) As Integer
End Class
Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button1.Click
Dim getdata As New IntPtr
Dim lan As Integer
lan = Win32.inrecv(i, j, getdata, 10, how, 10)[/CODE]
I'm getting a Pointer but with Marshal.PtrToSt ringAuto(getdat a) I don't get anything.
Can somebody help?
I've read already hundreds of articles but couldn't solve this.
Thanks.
I'm having some trouble in trying to use functions from a C dll in VB.Net.
I try to read a char array from memory with a pointer.
This is how it is working in c++
[CODE=cpp]typedef int ( WINAPI *INRECV )(int,int*,char *,int,int*,int) ;[/CODE]
and this is what I wrote in vb.net
[CODE=vbnet]Public Class Win32
Public Declare Function inrecv Lib "INTCP32.dl l" (ByVal i As Integer, ByRef j As Integer, ByRef s As IntPtr, ByVal k As Integer, ByRef l As Integer, ByVal m As Integer) As Integer
End Class
Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button1.Click
Dim getdata As New IntPtr
Dim lan As Integer
lan = Win32.inrecv(i, j, getdata, 10, how, 10)[/CODE]
I'm getting a Pointer but with Marshal.PtrToSt ringAuto(getdat a) I don't get anything.
Can somebody help?
I've read already hundreds of articles but couldn't solve this.
Thanks.
Comment