c++callbackedsdk

EDSDK callbacks not working


I have a working command line application, using EDSDK v2.13.

However, when I register callbacks, there is a burst of property events then nothing.

I have remedied this a loop like this:

while(!_kbhit())
{
  EdsOpenSession(camera);
  Sleep(10);
  EdsCloseSession(camera);
}

This seems horribly kludgy. Is the SDK broken, or am I missing something?


Solution

  • If you're using the EDSDK on Windows, you have to have a Windows message loop in your main thread, otherwise callbacks won't happen. (This is because the EDSDK uses the obsolete COM STA threading model instead of real threads.)