Honeywell 5180 Frozen Dessert Maker User Manual


 
6 - 7
return( 0 );
}
// Message Handler for image acquisition ended function (can be result of a failure as
well)
LRESULT OnEventMsg( WPARAM wParam,LPARAM lParam )
{
hhpEventTye_t eventType = (hhpEventType_t)wParam;// Event type
DWORD dwBytes = lParam; // Number of bytes in barcode. You
don’t actually use it here.
HHP_IMAGE Image; // Returned image structure.
TCHAR tcErrMsg[ 128 ]; // Error message buffer
Result_t nResult = RESULT_ERR_INTIALIZE; // Return code
// Verify the event type is barcode
if( eventType == HHP_IMAGE_EVENT )
{
// Set the HHP_IMAGE structure size and allocate a buffer for the data, set the
buffer size and how we want to receive the data in the buffer.
Image.dwStructSize = sizeof( HHP_IMAGE );
Image.puchBuffer = new BYTE[ 324000 ]; // Allocate a buffer big enough to
hold 640x480x8 plus header (if BMP)
Image.nBufferSize = 324000; // SDK wants to know how big the
buffer is so there’s no overflow
Image.fileFormat = FF_BMP_GRAY; // 8 bit bmp file format data
if( (nResult = hhpGetAsyncResult( &eventType,&Image )) == RESULT_SUCCESS )
{
// save image data to a bmp file and/or display it
}
else
{
hhpGetErrorMessage( nResult,tcErrMsg );
_tprintf( _T(“Capture Image Failed: %s\n”),tcErrMsg );
}
}
// Remember to delete your buffer
delete [ ] image.puchBuffer;
return( 0 );
}