Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8101667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:02:04+00:00 2026-06-05T23:02:04+00:00

I’m working on a Windows Mobile 6.1 app written in C#. I have recently

  • 0

I’m working on a Windows Mobile 6.1 app written in C#. I have recently added the ability to take photos. The device is an Intermec CN50. This code works fine if I open my app and go directly to the bit that takes photos. However if I go through a few other screens and then open the photo bit it fails with the incredibly useful message “An unknown error occurred”. There is no other useful information in the exception that I can see. The code fails on this line:

cameraResult = cameraDialog.ShowDialog();

Here’s the stack trace:

at Microsoft.WindowsMobile.Forms.CameraCaptureDialog.LaunchCameraCaptureDialog(IntPtr ptrStruct)
at Microsoft.WindowsMobile.Forms.CameraCaptureDialog.ShowDialog()
at MicronetMobileUi.Controls.Camera.ShowDialog(Form owner, String& fileName)
at MicronetMobileUi.FieldService.JobImagesForm.LoadCameraScreen()
at MicronetMobileUi.FieldService.JobImagesForm.footerToolbar_ItemEntered(Object sender, EventArgs e)
at Resco.Controls.CommonControls.ToolbarControl.OnItemEntered()
at Resco.Controls.CommonControls.ToolbarControl.MouseClickUp(MouseEventArgs e)
at Resco.Controls.CommonControls.ToolbarControl.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WnProc(WM wm, Int32 wParam, Int32 lParam)
at System.Windows.Forms.ContainerControl.WnProc(WM wm, Int32 wParam, Int32 lParam)
at System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)
at Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain)
at System.Windows.Forms.Application.Run(Form fm)
at MicronetMobileUi.ApplicationManager.StartApp()
at MicronetMobileUi.Program.Main()

Here’s the code:

var path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase);
var fileName = "temp.jpg";  
var pathAndFileName = Path.Combine(path, fileName);

var cameraDialog = new CameraCaptureDialog();
cameraDialog.Owner = this;
cameraDialog.InitialDirectory = path;
cameraDialog.DefaultFileName = fileName;
cameraDialog.Mode = CameraCaptureMode.Still;
cameraDialog.StillQuality = CameraCaptureStillQuality.Low;
cameraDialog.VideoTimeLimit = new TimeSpan(0, 0, 0);
cameraDialog.VideoTypes = CameraCaptureVideoTypes.Messaging;
cameraDialog.Resolution = new Size(640, 480); 

// open camera dialog to take a photo
DialogResult cameraResult;
try
{
    cameraResult = cameraDialog.ShowDialog();
}
catch (Exception ex)
{
    MessageBox.Show("Grrrr!!");
}       
finally
{
    cameraDialog.Dispose();
    cameraDialog = null;
}

if (cameraResult != DialogResult.OK)
    return; // no photo was taken

// save photo using this value: pathAndFileName ...

I guess this is something to do with running low on memory but I don’t really know. So far I’ve tried:

1) Instatiating CameraCaptureDialog when the app first starts up so it can get some memory.

2) Instatiating CameraCaptureDialog and also calling ShowDialog() when the app first starts up.

3) Closing my connection to the local SQL CE database before instantiating CameraCaptureDialog (this was suggested on a forum).

4) Running GC.Collect() before instantiating (yes I know this is not normally a good idea).

5) Reducing cameraDialog.Resolution to just 320 by 240.

Nothing works. I spent ages adding this functionality to my app and now I find it only actually works sometimes. Windows Mobile can be seriously annoying. Help!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T23:02:06+00:00Added an answer on June 5, 2026 at 11:02 pm

    I think that I’ve found some kind of answer.

    1) I added code to close my global connection to the local SQL CE database. This was suggested on a forum.

    2) I also added code to dispose my bar code object as suggested by tcarvin. However I was still experiencing the error occasionally.

    3) Then I noticed that the error only seems to come up when I am debugging with the device connected to Visual Studio. If I’m using it in the way a normal user would be using it then it seems OK. I certainly hope so anyway …

    UPDATE

    Now the app has been deployed to customers it seems that the problem is still happening. Also, sometimes they are able to load the camera screen and take a photo but the Windows comes up with a message saying “error cannot load file” or something similar. It they restart the application then it works but I can’t expect them to do that each time they want to take a photo. I will see if Intermec can help…

    FURTHER UPDATE:

    This happened a while ago so I’m a bit vague about the solution I found now. I’ve actually left that job and can’t look at the code now. In the end I got a compononet (I think a DLL) from Intermec that solved the problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.