I need to make a function for live view image in canon camera, but when I try to use the example code provided from canon I got some errors in variables. So I modified the code so that it could work. But the function EDSDK.EdsGetPropertyData returns the error code 98 (in hex 62) which represents the error EDS_ERR_INVALID_POINTER. I would like to know what is wrong in my code, and how can I proceed it.
IntPtr outData;
public void startLiveview(IntPtr camera)
{
uint err = EDSDK.EDS_ERR_OK;
EDSDK.EdsDataType device = new EDSDK.EdsDataType();
int size;
EDSDK.EdsOpenSession(camera);
// Get the output device for the live view image EdsUInt32 device; err = EdsGetPropertyData(camera, kEdsPropID_Evf_OutputDevice, 0 , , sizeof(device), &device );
// PC live view starts by setting the PC as the output device for the live view image. if(err == EDS_ERR_OK) { device |= kEdsEvfOutputDevice_PC;
err = EDSDK.EdsGetPropertySize(camera, EDSDK.PropID_Evf_OutputDevice, 0,out device, out size);
MessageBox.Show("Error result:"+err.ToString());
MessageBox.Show(device.ToString());
MessageBox.Show(size.ToString());
err = EDSDK.EdsGetPropertyData(camera, EDSDK.PropID_Evf_OutputDevice, 0, size, outData);
MessageBox.Show(outData.ToString());
if (err == EDSDK.EDS_ERR_OK)
{
//type2.GetType();
//device |= EDSDK.PropID_Evf_OutputDevice;
// err = EDSDK.EdsSetPropertyData(camera, EDSDK.PropID_Evf_OutputDevice, 0, sizeof(device), &device);
}
else
{
MessageBox.Show("Error result:" + err.ToString());
}
EDSDK.EdsCloseSession(camera);
}