VEO Camera Missing Method Exception

  • Thread starter Thread starter Y. Sivaram
  • Start date Start date
Y

Y. Sivaram

Hi,

I am trying to integrate the VEW Camera with my application

When I call the method
Private Declare Function CamStartSnapShot Lib "VEOCamAPI.dll" (ByVal hCom As
IntPtr, ByVal filename As String, ByVal resolution As Integer) As Boolean

As, I always get a missing method exception. Any ideas?

CamStartSnapShot(Handle, "\Test.jpg", 2)
 
Sorry the original function in C++ is

VEOCAMAPI_API HRESULT CamStartSnapshot(HANDLE hCam,TCHAR filename[], int
resolution)
 
Are you also getting an exception from CamOpen? That would mean missing DLL.
The definition is correct except of the return type which should be Integer
 
Alex,

Thanks.

I can get the preview of the image working fine without a glitch. Only this
CamStartSnapShot function fails. I guess it is the return value. I will
check this out as I do not have access to the camera now.

Best Regards,
Y. Sivaram
 
Help! I'm trying to whip up a project for work (with minimal knowledge of VB .NET). I managed to get my hands on the Veo camera.. Now, I tried running the code as provided by Y. Sivaram but I get the following error

An unhandled exception of type 'System.MissingMethodException' occurred in Test.exe

What did I do wrong???? (other than the obvious fact that I tried to bite off something more than I can chew on)..

Ken L

Code is as follows
---------------
Imports System.Threadin

Public Class Camer
Inherits System.Windows.Forms.For

Private Declare Function CamStartSnapShot Lib "SDIOCam.dll" (ByVal hCom As
IntPtr, ByVal filename As String, ByVal resolution As Integer) As Intege

Dim hCom As IntPt
Dim A As Integer = CamStartSnapShot(hCom, "test.jpg", 2

Private Sub InitializeComponent(

'Form

Me.ClientSize = New System.Drawing.Size(240, 488

End Su
End Class ' ThreadExceptionHandle
-----------
 
Ken,

Even I couldn't sort out this problem yet. But please ensure that you have
the SDIOCam.dll in the application folder and/or in the windows folder of
the PPC device.

Best Regards,

Y. Sivaram
Ken L said:
Help! I'm trying to whip up a project for work (with minimal knowledge
of VB .NET). I managed to get my hands on the Veo camera.. Now, I tried
running the code as provided by Y. Sivaram but I get the following error:
An unhandled exception of type 'System.MissingMethodException' occurred in Test.exe.

What did I do wrong???? (other than the obvious fact that I tried to bite
off something more than I can chew on)...
 
It appears that the function is either not there or takes different
arguments than you provide. Use dumpbin.exe to make sure it's exported and
not mangled, then check the headers of their SDK to make sure the parameters
are correct.

-Chris


Ken L said:
Help! I'm trying to whip up a project for work (with minimal knowledge
of VB .NET). I managed to get my hands on the Veo camera.. Now, I tried
running the code as provided by Y. Sivaram but I get the following error:
An unhandled exception of type 'System.MissingMethodException' occurred in Test.exe.

What did I do wrong???? (other than the obvious fact that I tried to bite
off something more than I can chew on)...
 
I have worked with the HP Photosmart camera, that I think has the same API.
Email me out of the usergroup for a sample that I think might work for the
VEO camera.

Nick

Chris Tacke said:
It appears that the function is either not there or takes different
arguments than you provide. Use dumpbin.exe to make sure it's exported and
not mangled, then check the headers of their SDK to make sure the parameters
are correct.

-Chris


Ken L said:
Help! I'm trying to whip up a project for work (with minimal knowledge
of VB .NET). I managed to get my hands on the Veo camera.. Now, I tried
running the code as provided by Y. Sivaram but I get the following error:
An unhandled exception of type 'System.MissingMethodException' occurred
in
Test.exe.

What did I do wrong???? (other than the obvious fact that I tried to
bite
off something more than I can chew on)...
Ken L.

Code is as follows:
----------------
Imports System.Threading

Public Class Camera
Inherits System.Windows.Forms.Form

Private Declare Function CamStartSnapShot Lib "SDIOCam.dll" (ByVal hCom As _
IntPtr, ByVal filename As String, ByVal resolution As
Integer)
As Integer
 
This function is exported from VeoCamAPI.dll and not from SDIOCam.DLL
VeoCamAPI needs to be manually placed on the device - you can include it in
your project and set the build action to Content.
For C# sample code see
http://www.alexfeinman.com/download.asp?doc=VeoCamera.cs


--
Alex Feinman
---
Visit http://www.opennetcf.org
Ken L said:
Help! I'm trying to whip up a project for work (with minimal knowledge
of VB .NET). I managed to get my hands on the Veo camera.. Now, I tried
running the code as provided by Y. Sivaram but I get the following error:
An unhandled exception of type 'System.MissingMethodException' occurred in Test.exe.

What did I do wrong???? (other than the obvious fact that I tried to bite
off something more than I can chew on)...
 
Ok.. This is from the VEO SDK Documentation..
How would I be able to call up the Snapshot function in VB .NET??!??!

Camera SDIO SDK Specificatio

SDK Interfac
1. BOOL SDIOCamVersion(HANDLE hCom, TCHAR *DriverVersion)
Description
Get driver version informatio
Params
hCom : Camera Device Handl
DriverVersion : buffer to receive dat
Return Valu
Zero if fail,otherwise not zero

2. BOOL SDIOCamData(HANDLE hCom,
UCHAR *ScreenBufShow, DWORD *ll)
Description
Get frame data from driver
Params
hCom : Camera Device Handl
ScreenBufShow : Buffer to receive frame dat
ll : To receive data length
Return valu
Zero if fail,otherwise not zero

3. BOOL SDIOCamInit(HANDLE hCom, HWND Mainhwnd )
Descriptio
Device initialization
Param
hCom : Camera Device Handl
Mainhwnd : Handle of Application main windo
Return valu
Zero if fail,otherwise not zero

4. BOOL SDIOCamSnapShot(HANDLE hCom,
TSNAPINFO snapshotinfo
Descriptio
Request for doing snap shot
Param
hCom : Camera Device Handl
snapshotinfo : Image quality to achieve and file nameã€directory information
resolution and moreâ€
Return Valu
Zero if fail,otherwise not zero

5. BOOL SDIOCamPreviewStart(HANDLE hCom, HWND hwVideo
int prvmode)
Descriptio
Request for starting preview
Param
hCom : Camera Device Handl
hwVideo : Handle of Video windo
prvmode : preview mode, values
PREVIEW_160_120_1X : preview with 160*120 and zoom 1
PREVIEW_160_120_2X : preview with 160 *120 and zoom 2
PREVIEW_160_120_4X: preview with 160 *120 and zoom 4
PREVIEW_320_240_1X: preview with 320*240 and zoom 1
PREVIEW_320_240_2X: preview with 320*240 and zoom 2
PREVIEW_320_240_4X: preview with 320*240 and zoom 4
Return valu
Zero if fail,otherwise not zero

6. BOOL SDIOCamPreviewStop(HANDLE hCom
Descriptio
Request for stopping preview
Param
hCom : Camera Device Handl
Return valu
Zero if fail,otherwise not zero

7. BOOL SDIOCamPowerOff(HANDLE hCom)
Descriptio
Request for shutting down the power of camera
Param
hCom : Camera Device Handl
Return valu
Zero if fail,otherwise not zero
8. BOOL SDIOCamSetting(HANDLE hCom,
PARAMETERINFO parainfo
Descriptio
request for Setting the mode of video or snapshot picture
Param
hCom : Camera Device Handl
Parainfo : Mode information to be se
Return valu
Zero if fail,otherwise not zero

9. void SDIOCamPreviewInit( void
Descriptio
Initialize to previe
Param
NUL
Return valu
No return value

10. BOOL SDIOCamDeCode( int PreMode, UCHAR *inBuf
UCHAR *outBuf, ULONG dataLenLeft
Descriptio
Decode Image data from JPEG formate to BMP format
Param
PreMode: Preview Mode.( as SDIOCamPreviewStart
InBuf : Buffer of JPEG data source to decod
OutBuf : Buffer to receive decoded BMP data
DataLenLeft : Data length of JPEG data source
Return valu
Zero if fail,otherwise not zero

ï¬ Structures Definition Neede
1ï¼
typedef struct imgcolor_struct
UCHAR avRed
UCHAR avGreen
UCHAR avBlue
UCHAR avY
}Imagecolor

Descriptio
This structure defines the color informatio
Member
avRed : Value of re
avGreen : Value of gree
avBlue :Value of blu
avY : Brightnes


2.
typedef struct _TSNAPINFO
UCHAR resolution;
UCHAR quality;
TCHAR filename[100]
int inbufferlen
unsigned char *imgbuff
int *outbufferlen
HINSTANCE hinst
} TSNAPINFO, *PTSNAPINFO

Descriptio
This structure defines the information of snapshot picture when requesting for do snapsho
Member
resolution : resolution of snapshot picture. Values
TAKPIC_1280_1024: 1280 *1024 wiht zoom 1x
TAKPIC_1280_960: 1280 *960 wiht zoom 1x
TAKPIC_640_480: 640 *480 wiht zoom 1x
TAKPIC_320_240: 320*240 with zoom 1
TAKPIC_640_480_2X: 640 *480 wiht zoom 2x
TAKPIC_320_240_2X: 320 *240 wiht zoom 2
TAKPIC_320_240_4X: 320*240 with zoom 4
quality : quality of snapshot picture. 0 : good 1: better 2: bes
filename : file name of picture to save(full name, directory inside)
inbufferlen:
imgbuff:
outbufferlen:
hinst:


3.
typedef struct{
int WhiteBalance;
int Color;
int Compression;
int AeMetering;
}_PARAMETERINFO, *_pPARAMETERINFO;

Description
This structure defines the information of snapshot picture when do setting
Members
WhiteBalance : Mode of whitebalance. Values:
WB_AUTO: auto;
WB_SUN: sun;
WB_TUNGSTEN: tungsten;
WB_FLUORESCENT: fluorescent;
Color : Color of picture, (0: full color; 1: black & white; 2: negative;
3: negative; 4: cool )
Compression : Compression of picture ,( 0: good; 1: better; 2: best )
AeMetering : AeMetering of picture,( 0: average; 1: center-weighted; 2:spot)


ï¬ Preview Mode and Snapshot resolution values

For Snapshot:
Zoom*1:
#define TAKPIC_1280_1024 0 //1280 *1024 wiht 1x
#define TAKPIC_1280_960 1 //1280 *960 wiht 1x
#define TAKPIC_640_480 2 //640 *480 wiht 1x
#define TAKPIC_320_240 4 // 320*240 with 1x

Zoom*2:
#define TAKPIC_640_480_2X 7 //640 *480 wiht 2x
#define TAKPIC_320_240_2X 8 //320 *240 wiht 2x

Zoom*4:
#define TAKPIC_320_240_4X 17 // 320*240 with 4x

For Preview:
#define PREVIEW_160_120_1X 6 //preview with 160*120 and zoom 1x
#define PREVIEW_160_120_2X 20 //preview with 160 *120 and zoom 2x
#define PREVIEW_160_120_4X 21 //preview with 160 *120 and zoom 4x

#define PREVIEW_320_240_1X 4 // 320*240 with zoom 1x
#define PREVIEW_320_240_2X 9 //preview with 320*240 and zoom 2x
#define PREVIEW_320_240_4X 17 // 320*240 with zoom 4x

ï¬ White balance values

#define WB_AUTO 0 //auto
#define WB_SUN 1 //sun
#define WB_TUNGSTEN 2 //tungsten
#define WB_FLUORESCENT 3 //fluorescent


All above need SDIOCam.h 〠SDIOCam.lib 〠SDIOCam.dll
 
.... You're right Chris. I checked the SDK documentation again and, as Alex has mentioned, the function exists only in veocampapi.dll and not SDIOCam.dll

So now, I'm trying to call this function from the SDK ..

7. BOOL SDIOCamPowerOff(HANDLE hCom)
Descriptio
Request for shutting down the power of camera

Param
hCom : Camera Device Handl
Return value Zero if fail, otherwise not zero

Using the following

Private Declare Function SDIOCamPowerOff Lib "SDIOCam.dll" (ByVal hCom As IntPtr) As Boolea
Dim A As Boolean = SDIOCamPowerOff(hCom

I STILL get the error message: "An unhandled exception of type 'System.MissingMethodException' occurred in ...

So I'm stumped once again...
 
Run dumpbin.exe on the lib or dll and see what exactly is exported.

-Chris


Ken L said:
... You're right Chris. I checked the SDK documentation again and, as
Alex has mentioned, the function exists only in veocampapi.dll and not
SDIOCam.dll.
So now, I'm trying to call this function from the SDK ...

7. BOOL SDIOCamPowerOff(HANDLE hCom)
Description
Request for shutting down the power of camera

Params
hCom : Camera Device Handle
Return value Zero if fail, otherwise not zero;

Using the following:

Private Declare Function SDIOCamPowerOff Lib "SDIOCam.dll" (ByVal hCom As IntPtr) As Boolean
Dim A As Boolean = SDIOCamPowerOff(hCom)

I STILL get the error message: "An unhandled exception of type
'System.MissingMethodException' occurred in ..."
 
Not fun. Needs quite some work.

--
Alex Feinman
---
Visit http://www.opennetcf.org
Ken L said:
Ok.. This is from the VEO SDK Documentation...
How would I be able to call up the Snapshot function in VB .NET??!??!?

Camera SDIO SDK Specification

SDK Interface
1. BOOL SDIOCamVersion(HANDLE hCom, TCHAR *DriverVersion)
Description:
Get driver version information
Params
hCom : Camera Device Handle
DriverVersion : buffer to receive data
Return Value
Zero if fail,otherwise not zero;

2. BOOL SDIOCamData(HANDLE hCom,
UCHAR *ScreenBufShow, DWORD *ll)
Description:
Get frame data from driver
Params
hCom : Camera Device Handle
ScreenBufShow : Buffer to receive frame data
ll : To receive data length
Return value
Zero if fail,otherwise not zero;

3. BOOL SDIOCamInit(HANDLE hCom, HWND Mainhwnd )
Description
Device initialization
Params
hCom : Camera Device Handle
Mainhwnd : Handle of Application main window
Return value
Zero if fail,otherwise not zero;

4. BOOL SDIOCamSnapShot(HANDLE hCom,
TSNAPINFO snapshotinfo)
Description
Request for doing snap shot
Params
hCom : Camera Device Handle
snapshotinfo : Image quality to achieve and file name?directory information,
resolution and more.
Return Value
Zero if fail,otherwise not zero;

5. BOOL SDIOCamPreviewStart(HANDLE hCom, HWND hwVideo,
int prvmode)
Description
Request for starting preview
Params
hCom : Camera Device Handle
hwVideo : Handle of Video window
prvmode : preview mode, values:
PREVIEW_160_120_1X : preview with 160*120 and zoom 1x
PREVIEW_160_120_2X : preview with 160 *120 and zoom 2x
PREVIEW_160_120_4X: preview with 160 *120 and zoom 4x
PREVIEW_320_240_1X: preview with 320*240 and zoom 1x
PREVIEW_320_240_2X: preview with 320*240 and zoom 2x
PREVIEW_320_240_4X: preview with 320*240 and zoom 4x
Return value
Zero if fail,otherwise not zero;

6. BOOL SDIOCamPreviewStop(HANDLE hCom)
Description
Request for stopping preview
Params
hCom : Camera Device Handle
Return value
Zero if fail,otherwise not zero;

7. BOOL SDIOCamPowerOff(HANDLE hCom)
Description
Request for shutting down the power of camera
Params
hCom : Camera Device Handle
Return value
Zero if fail,otherwise not zero;
8. BOOL SDIOCamSetting(HANDLE hCom,_
PARAMETERINFO parainfo)
Description
request for Setting the mode of video or snapshot picture
Params
hCom : Camera Device Handle
Parainfo : Mode information to be set
Return value
Zero if fail,otherwise not zero;

9. void SDIOCamPreviewInit( void )
Description
Initialize to preview
Params
NULL
Return value
No return value;

10. BOOL SDIOCamDeCode( int PreMode, UCHAR *inBuf,
UCHAR *outBuf, ULONG dataLenLeft)
Description
Decode Image data from JPEG formate to BMP format
Params
PreMode: Preview Mode.( as SDIOCamPreviewStart)
InBuf : Buffer of JPEG data source to decode
OutBuf : Buffer to receive decoded BMP data.
DataLenLeft : Data length of JPEG data source
Return value
Zero if fail,otherwise not zero;

? Structures Definition Needed
1.
typedef struct imgcolor_struct {
UCHAR avRed;
UCHAR avGreen;
UCHAR avBlue;
UCHAR avY;
}Imagecolor;

Description
This structure defines the color information
Members
avRed : Value of red
avGreen : Value of green
avBlue :Value of blue
avY : Brightness


2.
typedef struct _TSNAPINFO {
UCHAR resolution;
UCHAR quality;
TCHAR filename[100];
int inbufferlen;
unsigned char *imgbuff;
int *outbufferlen;
HINSTANCE hinst;
} TSNAPINFO, *PTSNAPINFO;

Description
This structure defines the information of snapshot picture when requesting for do snapshot
Members
resolution : resolution of snapshot picture. Values:
TAKPIC_1280_1024: 1280 *1024 wiht zoom 1x
TAKPIC_1280_960: 1280 *960 wiht zoom 1x
TAKPIC_640_480: 640 *480 wiht zoom 1x
TAKPIC_320_240: 320*240 with zoom 1x
TAKPIC_640_480_2X: 640 *480 wiht zoom 2x
TAKPIC_320_240_2X: 320 *240 wiht zoom 2x
TAKPIC_320_240_4X: 320*240 with zoom 4x
quality : quality of snapshot picture. 0 : good 1: better 2: best
filename : file name of picture to save(full name, directory inside).
inbufferlen:
imgbuff:
outbufferlen:
hinst:


3.
typedef struct{
int WhiteBalance;
int Color;
int Compression;
int AeMetering;
}_PARAMETERINFO, *_pPARAMETERINFO;

Description
This structure defines the information of snapshot picture when do setting
Members
WhiteBalance : Mode of whitebalance. Values:
WB_AUTO: auto;
WB_SUN: sun;
WB_TUNGSTEN: tungsten;
WB_FLUORESCENT: fluorescent;
Color : Color of picture, (0: full color; 1: black & white; 2: negative;
3: negative; 4: cool )
Compression : Compression of picture ,( 0: good; 1: better; 2: best )
AeMetering : AeMetering of picture,( 0: average; 1: center-weighted; 2:spot)


? Preview Mode and Snapshot resolution values

For Snapshot:
Zoom*1:
#define TAKPIC_1280_1024 0 //1280 *1024 wiht 1x
#define TAKPIC_1280_960 1 //1280 *960 wiht 1x
#define TAKPIC_640_480 2 //640 *480 wiht 1x
#define TAKPIC_320_240 4 // 320*240 with 1x

Zoom*2:
#define TAKPIC_640_480_2X 7 //640 *480 wiht 2x
#define TAKPIC_320_240_2X 8 //320 *240 wiht 2x

Zoom*4:
#define TAKPIC_320_240_4X 17 // 320*240 with 4x

For Preview:
#define PREVIEW_160_120_1X 6 //preview with 160*120 and zoom 1x
#define PREVIEW_160_120_2X 20 //preview with 160 *120 and zoom 2x
#define PREVIEW_160_120_4X 21 //preview with 160 *120 and zoom 4x

#define PREVIEW_320_240_1X 4 // 320*240 with zoom 1x
#define PREVIEW_320_240_2X 9 //preview with 320*240 and zoom 2x
#define PREVIEW_320_240_4X 17 // 320*240 with zoom 4x

? White balance values

#define WB_AUTO 0 //auto
#define WB_SUN 1 //sun
#define WB_TUNGSTEN 2 //tungsten
#define WB_FLUORESCENT 3 //fluorescent


All above need SDIOCam.h ? SDIOCam.lib ? SDIOCam.dll
 
Back
Top