PDA

View Full Version : Ask for Help


zjc36
12-05-2006, 06:00 AM
I want to get a still picture by using SHCameraCapture(). But it return E_FAIL. Our OS is Windows Mobile 5.0
HRESULT CameraCaptureExample(HWND hwndOwner, LPTSTR pszFilename)
{
HRESULT hResult;
SHCAMERACAPTURE shcc;

// Set the SHCAMERACAPTURE structure.
ZeroMemory(&shcc, sizeof(shcc));
shcc.cbSize = sizeof(shcc);
shcc.hwndOwner = hwndOwner;
shcc.pszInitialDir = TEXT("\\My Documents");
shcc.pszDefaultFileName = TEXT("test.jpg");
shcc.pszTitle = TEXT("Camera Demo");
shcc.VideoTypes = CAMERACAPTURE_VIDEOTYPE_ALL;
shcc.nResolutionWidth = 176;
shcc.nResolutionHeight = 144;
shcc.nVideoTimeLimit = 15;
shcc.Mode = CAMERACAPTURE_MODE_STILL;

// Display the Camera Capture dialog.
hResult = SHCameraCapture(&shcc);

// The next statements will execute only after the user takes
// a picture or video, or closes the Camera Capture dialog.
if (S_OK == hResult)
{
StringCchCopy(pszFilename, MAX_PATH, shcc.szFile);
}

return hResult;
}

HDuser
17-05-2006, 08:17 AM
Moved topic from about

ady
17-05-2006, 08:53 AM
On which device are you working?

zjc36
18-05-2006, 04:36 AM
My device is one kind of Pocket PC with Camera.
now I have been useing DeviceIoControl() to got the picture from device.
I want to ask in which condition I can use this function--SHCameraCapture()