469,898 Members | 1,417 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,898 developers. It's quick & easy.

Urgent:Convert C++ Function Pointer to VB.Net

1
To all gurus,

I am currently converting some of C++ codes to VB.net

The C++ Codes is as follows :

================= C++ CODE ==================
typedef struct _tagBBCameraParameter
{
unsigned int preview_width;
unsigned int preview_height;
unsigned int preview_x;
unsigned int preview_y;
unsigned int preview_format;
unsigned int preview_zoom;

const TCHAR* capture_file_name;

unsigned int contrast;
unsigned int saturation;
unsigned int brightness;

} BBCameraParameter;

typedef LPVOID HBBCAMERA;

BBAPI DWORD WINAPI BBCameraPreviewStart(HBBCAMERA, BBCameraParameter*);
BBAPI DWORD WINAPI BBCameraPreviewStop(HBBCAMERA);

================= END C++ CODE ==================

I managed to convert most of the codes to VB.Net but when I try to fun BBCameraPreviewStart function, it gives error.

'=================Partial VB.Net Code


Public Shared Function BBCameraPreviewStart(ByVal HBBCamera As IntPtr, ByRef BBParam1 As BBCameraParameter) As Integer
End Function

Public Shared Function BBCameraPreviewStop(ByVal HBBCamera As IntPtr) As Integer
End Function

'=========== END OF PARTIAL VB.NET CODES

This is how i pass the parameters;

Dim BBParam as BBCameraParameter '// already declared but not shown here
Dim HBBCamera as IntPtr '//Handle

'I have no problems getting handle but once i set the parameters for BBParam and pass as follows, i get error (not much help from the message).

BBCameraPreviewStart(HBBCAMERA, BBParam)

How do I call function BBCameraPreviewStart correctly? Did i do it correctly?

Please advices.
Thanks
Mar 14 '07 #1
0 1150

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by XML newbie: Urgent pls help! | last post: by
reply views Thread by Filipe | last post: by
7 posts views Thread by meenasamy | last post: by
3 posts views Thread by N. Spiker | last post: by
1 post views Thread by dasilva109 | last post: by
4 posts views Thread by Peter | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.