Error in creating ICameraFrameModel | developer.brewmp.com Error in creating ICameraFrameModel | developer.brewmp.com

Developer

Error in creating ICameraFrameModel

Hi all,

I'm following API reference doc to develop a camera app. The problem is that I can not create an instance of ICameraFrameModel, this is the instruction, which always returns 3(ClassNotSupport!? :confused: :( ).

ISHELL_CreateInstance(pIShell, AEECLSID_CAMERAFRAMEMODEL, (void **)&pIFrame);

The ID of ICameraFrameModel was added to MIF file already(which is 0x01035C90), and AEECameraFrameModel.h was included, too.

Bellowing are all the code, has anyone got any idea? ;)

ICameraFrameModel *pIFrame;
ICamera *pICamera;
int nErr;

AEESize size;
size.cx = 50;
size.cy = 50;

// Create a frame to hold the camera
ISHELL_CreateInstance(pIShell, AEECLSID_FRAMEWIDGET, (void **)ppICameraFrameWidget);

// Create camera
nErr = ISHELL_CreateInstance(pIShell, AEECLSID_CAMERA, (void **)&pICamera);
if (SUCCESS != nErr)
{
// Handle error condition
DBGPRINTF("Error");
return;
}

ICAMERA_SetSize(pICamera, &size);
ICAMERA_SetDisplaySize(pICamera, &size);

// Create camera frame model
nErr = ISHELL_CreateInstance(pIShell, AEECLSID_CAMERAFRAMEMODEL, (void **)&pIFrame);

// Attach camera to model
ICAMERAFRAMEMODEL_SetICamera(pIFrame, pICamera);

IWIDGET_SetModel(*ppICameraFrameWidget, pIFrame);

Have you tested it on device? If not give it a try

Have you tested it on device? If not give it a try

No, I dont have a compiler here, just run in Kyocera A5502K simulator.

No, I dont have a compiler here, just run in Kyocera A5502K simulator.

Like Some of the IMedia objects only gets created on the device. So this might be case with the ICamera also.

Like Some of the IMedia objects only gets created on the device. So this might be case with the ICamera also.

It's not the problem of ICamera, I can create an instance of ICamera in simulator with DirectShow supported webcam attached to my computer.

It's not the problem of ICamera, I can create an instance of ICamera in simulator with DirectShow supported webcam attached to my computer.