void **ppImageBuffer

G

Guest

Hi Experts,

I am trying to use a C++ dll from my VB .NET program, but I don't know how
to handle things like void **ppImageBuffer. Please see the following and help
me out.

Thanks.

//C++ dll
int WINAPI CameraSetValue(short nParameter, void *pValue);

int WINAPI CameraGetImages(int nNumImages, void **ppImageBuffer);

'VB .NET
<DllImport("Camera.dll")>
Public shared Function SpotSetValue(ByVal nParameter As Short,
????What_to_put_here????) As Integer
End Function

<DllImport("Camera.dll")>
Public shared Function CameraGetImages(int nNumImages,
????What_to_put_here????) As Integer
End Function
 
M

Mattias Sjögren

//C++ dll
int WINAPI CameraSetValue(short nParameter, void *pValue);

int WINAPI CameraGetImages(int nNumImages, void **ppImageBuffer);

'VB .NET
<DllImport("Camera.dll")>
Public shared Function SpotSetValue(ByVal nParameter As Short,
????What_to_put_here????) As Integer
End Function

<DllImport("Camera.dll")>
Public shared Function CameraGetImages(int nNumImages,
????What_to_put_here????) As Integer
End Function

In the most general form

Public shared Function SpotSetValue(ByVal nParameter As Short,
ByVal pValue As IntPtr) As Integer

and

Public shared Function CameraGetImages(int nNumImages, ByRef
ppImageBuffer As IntPtr) As Integer

But if you acually know what tyoe of data you're going to pass in and
get back, there's a good chance you can save some work by using a more
specific parameter type.


Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top