Question : interpreting C++ code into VB.NET

I am trying to use a vendor-supplied dll written in C code where the declaration in the dll looks like this:
extern "C" __stdcall int tira_get_captured_data (
const unsigned char** data,
int* size );

How does that translate into a VB.Net compatible function?

Thanks in advance.

(Maybe useful information here, but not simple enough for me...
http://www.home-electro.com/download/tiraAPI.pdf)

Answer : interpreting C++ code into VB.NET

Try something like this
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
<DllImport("tira2.dll", CharSet:=CharSet.Auto)> _
    Private Shared Function tira_get_captured_data(ByRef data As IntPtr, ByRef size As Integer) As Integer
    End Function

    <DllImport("tira2.dll", CharSet:=CharSet.Auto)> _
    Private Shared Function tira_delete(ByVal ptr As IntPtr) As Integer
    End Function


    Sub Tira()

        Dim data As IntPtr = IntPtr.Zero
        Dim dataSize As Integer = 0
        Dim res As Integer = 0

        res = tira_get_captured_data(data, dataSize)

        '//TODO: Work with (data) pointer.

        If data.ToInt32 <> 0 Then
            ' free heap memory
            res = tira_delete(data)
        End If

    End Sub
Random Solutions  
 
programming4us programming4us