Cannot set InitialDirectory on cameracapturedialog (WinMobile 6) RRS feed

  • Question

  • Hi,

    When i show my cameracap dialog, i get an argument exception. It only happens, if i try to change initialdir.

    What am i doing wrong? I know hardcoding storage card directory is not very good, but i have checked the dirs, and it is called storage card on my test device.

        private void TakePicture(clsFinding.PhotoArea Area)
          Microsoft.WindowsMobile.Forms.CameraCaptureDialog CamCapture =
            new Microsoft.WindowsMobile.Forms.CameraCaptureDialog();
          CamCapture.Mode = Microsoft.WindowsMobile.Forms.CameraCaptureMode.Still;
          CamCapture.StillQuality = Microsoft.WindowsMobile.Forms.CameraCaptureStillQuality.High;
          DirectoryInfo root = new DirectoryInfo("\\");
          DirectoryInfo[] directoryList = root.GetDirectories();
          string strPathToPictures = @"\Storage Card\LM_Inspections\" + _Case.SerialNo +
          if (!Directory.Exists(strPathToPictures))
          CamCapture.InitialDirectory = strPathToPictures;
          DialogResult DResult = CamCapture.ShowDialog();

    Nicolai Søndergaard - LM Wind Power A/S
    Wednesday, December 15, 2010 9:32 AM

All replies


    Hi Nicoolai,


    I'm Jesse and I'll be helping you.


    So For your issue is argument exception. Did it happen at this line?



    Or what is your application environment?


    Best regards,



    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, December 17, 2010 8:35 AM
  • It happens on

    DialogResult DResult = CamCapture.ShowDialog();

    Nicolai Søndergaard - LM Wind Power A/S
    Friday, December 17, 2010 8:36 AM