I'm trying to write a program for my iPaq hx4700 with a photosmart
mobile camera using the SDK available from HP and I am having mixed results.

I can use the functions to take a snapshot and save it as a jpg but the
functions to get the buffer data then translate it from jpg to bmp are
failing. Any help would be appreciated.

bDecode is a global variable because I was picking to bools from the
function (ugly but temporary). This has consistantly been false while
SDIOCamSnapShot has completed successfuly.

BOOL TakeSnapshot(HWND hWnd, LPCTSTR filename) {
TSNAPINFO snapshotinfo;


int iRes = 4; //4:320*240
int iQuality = 2; //best

ULONG uImgLen=NULL;
DWORD ll=NULL;
Imagecolor color;

lstrcpy(snapshotinfo.filename, filename);

snapshotinfo.quality = iQuality;
snapshotinfo.inbufferlen = 0;
snapshotinfo.imgbuff = NULL;
snapshotinfo.outbufferlen = 0;
snapshotinfo.resolution = iRes;

color.avBlue = 0;
color.avGreen = 0;
color.avRed = 0;
color.avY = 0;

SDIOCamPreviewInit();
SDIOCamPreviewStart(hCom, hWnd, 4);

bDecode=SDIOCamData(hCom, color, inBuf, ll);
if (bDecode)
SDIOCamDeCode(0, inBuf, outBuf, uImgLen);

BOOL success = SDIOCamSnapShot(hCom, snapshotinfo);
SDIOCamPreviewStop (hCom);
return success;
}