Search code examples
c#exceptioncamerapocketpc

camera in Windows Mobile 5.0 Pocket PC


I'm developing a C#, Windows mobile app and I need to launch my device camera:

This is my code:

        CameraCaptureDialog ccd = new CameraCaptureDialog();
        ccd.ShowDialog();//<--- 
        pictureBox1.Image = new Bitmap(ccd.FileName);

In the ccd.ShowDialog();//<--- this line shows me the next exception: System.InvalidOperationException: An unknown error occurred.

I dont know if the exception is because of my Windows Mobile 5.0 Pocket PC doesn't have the camera built in. Or what I'm trying to do will never works..

So... Anybody could tell me something?


Solution

  • In fact, the Windows Mobile 5.0 Pocket PC emulator doesn't have a built-in camera, that's why all my tries were unsuccessful..

    When I built the app, and installed it on my device, I ran the app and...

    SURPRISE!!! IT WORKED!!

    So... My conclussion is:

    The code lines work! but only on my device, They wont work on the WMPPC emulator...

    If somebody has a different answer.. Let me know it.