I am trying to creat an Program for my Canon EOS Rebel T7, but when I try to send the command EDSDK.EdsSendCommand(CamConn,EDSDK.CameraCommand_TakePicture, 0) the program returns the error EDS_ERR_INVALID_HANDLE, how I can add an proper Handle for taking picktures? Thanks! Print of code here
First, welcome to StackOverflow.
Tip for the future: copy/paste code into your question and don't link to a picture. It's easier for everyone to read and maybe copy it to try things themselves.
Now to your question:
Where does the
CamConnhandle come from? It's very likely that the OpenConnection call already returns an invalid handle error.To get a valid camera handle you have to do the following:
Note that I haven't checked the returned error codes for simplicity but you should definitely check them.