Error InvalidOperationException unhandled - help needed urgently

hi,



I have implemented the code for cameracapturedialog using WM 5.0 and VS 2005 and Windows 2000 professional OS .I m getting error using the ShowDialog() method of the CameraCaptureDialog.

Code is like this
CameraCaptureDialog cameraCapture = new CameraCaptureDialog();
cameraCapture.Owner = this;
cameraCapture.Mode = CameraCaptureMode.Still;
cameraCapture.StillQuality = CameraCaptureStillQuality.High;
cameraCapture.Resolution = new Size(175, 150);
cameraCapture.DefaultFileName = @"test.jpg";
cameraCapture.InitialDirectory = @"\My Documents";
cameraCapture.ShowDialog();




Stack Trace
==========================
System.InvalidOperationExceptoion: {"An unknown error occurred."}
InnerException: null
Message: "An unknown error occurred."
StackTrace: "at Microsoft.WindowsMobile.Forms.CameraCaptureDialog.LaunchCameraCaptureDialog()\r\nat Microsoft.WindowsMobile.Forms.CameraCaptureDialog.ShowDialog()\r\nat NCamera.Camera.startCamera()\r\nat NCap.Screen.Btn_TakePicture_Click()\r\nat System.Windows.Forms.MenuItem.OnClick()\r\nat System.Windows.Forms.Menu.ProcessMnuProc()\r\nat System.Windows.Forms.Form.WnProc()\r\nat System.Windows.Forms.Control._InternalWnProc()\r\nat Microsoft.AGL.Forms.EVL.EnterMainLoop()\r\nat System.Windows.Forms.Application.Run()\r\nat NCap.Program..ctor()\r\nat NCap.Program.Main()\r\n"



Answer this question

Error InvalidOperationException unhandled - help needed urgently

  • robinjam

    I have the same problem on my Qtek S200. It used to be fine until I installed a .net compact Service Pack. It seems ok once I remove the device from Active sync, and soft reset it, then it works intermittingly.

    I pop the inmage into a sql compact database. Is there a resolution for this problem in the pipeline as my app is launching shortly.

    Dave


  • SCRunner

    The emulator does not emulate a camera. You need an actual device

  • connectionLink

    hye_heena wrote:

    How can i resolve this cant v have the emulators having the facility of camera by certain settings

    No. You need an actual device with a camera



  • gleason78

    Most Windows Mobile 5 devices I tried worked just fine. Among those Imate Jamin and JasJar, HP 6915

  • CiNN

    thanx for help. But then how can i test the app i m supposed to make the appliction for capturing the picture the provide the facility of changing the file name. How can i resolve this cant v have the emulators having the facility of camera by certain settings


  • Virgoss

    Hi Alex

    I see that you say that you have tested on the HP6915. I am experiencing the same error on the hp6915 when trying to call the cameracapturedialog.showdialog() method .

    what am I doing wrong

    code that I am using below:

    CameraCaptureDialog cameraCapture = new CameraCaptureDialog();

    cameraCapture.Owner = null;

    cameraCapture.InitialDirectory = @"\My Documents";

    cameraCapture.DefaultFileName = @"test.jpg";

    cameraCapture.Title = "Camera Demo";

    cameraCapture.VideoTypes = CameraCaptureVideoTypes.Messaging;

    cameraCapture.Resolution = new Size(176, 144);

    cameraCapture.VideoTimeLimit = new TimeSpan(0, 0, 15); // Limited to 15 seconds of video.

    cameraCapture.Mode = CameraCaptureMode.VideoWithAudio;

    cameraCapture.ShowDialog();

    if (DialogResult.OK == cameraCapture.ShowDialog())

    {

    Console.WriteLine("The picture or video has been successfully captured to:\n{0}", cameraCapture.FileName);

    }

    many thanks.


  • Damiaan

    hi, i too have the same problem as alex with the hp hw6915. does anybody know a solution

    thanx,

    Klaus


  • webbsk

    This would suggest that your device has some issues with the camera driver or else there is not enough memory available. What is the device

  • Areej

    hi,

    It got worked on o2 XDA 2. i want other devices on which it works. Coz i have to test app on various WM 5.0 enabled devices, help needed.


  • AbhijeetG

    okay. Thanx again. Lets hope it gets done.





  • Wilk06

    okay. thanx again. But i have came to know that CameraCaptureDialog is not working with many of the devices, can u suggest me which type of device needed, coz depending on this i can further proceed.



    Thanx in advance.


  • Magdalena_Heidi

    i am creating the appln for pocket pc emulator. Is it tht i have to run the app on device only cant i run it on emulator. for capturing the snap


  • Error InvalidOperationException unhandled - help needed urgently