SHCameraCapture is the C++ (native) function for launching a dialog ( see http://msdn.microsoft.com/en-us/library/bb160743.aspx)

Its C# (.NET) equivalent is CameraCaptureDialog  ( http://msdn.microsoft.com/en-us/library/microsoft.windowsmobile.forms.cameracapturedialog.aspx )

While relatively easy to use, they are both prone to causing memory faults (exceptions indicating low memory) or the API appears to 'lock up'.

While this seems to be an indication that the amount of memory (available RAM) to the application or the system is low, this is likely not the case:  it is more than likely an issue concerning STACK memory

Please see the following link for a detailed synopsis of memory related issues on Windows Mobile based devices:  http://www.developer.com/tech/article.php/3588021/Big-Mistakes-To-Avoid-in-Windows-Mobile-Development.htm

Here are a few tips to help avoid the issue:

  • If you are using SHCameraCapture (C++ apps), then you can increase the amount of stack size via Linker options (default is 64Kb).
  • Minimize the amount of dialogs that are currently open when you attempt to launch the camera dialog (dialogs take enormous amounts of stack memory).
  • When using CameraCaptureDialog, close and dispose of the object immediately within the confines of its own function.  Avoid calling it openly within a UI operation (e.g. button push).  Put it into its own function where it is invoked and disposed of before returning to the UI code.
  • Where possible, move the invocation of the camera dialog to its own thread, because threads have their own private stack space. 

Psion Teklogix has come up with a more attractive alternative to Microsoft's camera dialogs:

http://community.psionteklogix.com/downloads/developer_sdkhdk/m/sample__demo_code/1169.aspx

This demo shows you how to create a window control (in both C# and C++) that allows you to embed the camera control within a form/window, rather than needing to popup another dialog to handle the camera.