<p>I need to show a camera capture dialog in a compact framework 3.7 application by pinvoking SHCameraCapture from the dll Aygshell.dll.  I cannont use the managed object CameraCaptureDialog because of limitations with the technology I'm working with.  Instead, I need to access it by Pinvoking it.</p>

<p>See <a href="http://msdn.microsoft.com/en-us/library/aa454995.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/aa454995.aspx</a> for documentation on the function.  The function takes in a struct that defines the parameters of the dialog.  e.g. where to save the file, what resolution to use.</p>

<p>I would imaging that I would have to define a copy of the struct in C# and decorate the sturct with the attribute StructLayout.  I also imagine that the code would involve [DllImport("aygshell.dll")].  Any sample code of how to call this would be much appreciated.</p>

I've not been able to test this, but your struct/function should look something like this:
```
```
struct SHCAMERACAPTURE {
  public Int32 cbSize;
  public IntPtr hwndOwner;

  [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]  
  public string szFile;

  [MarshalAs(UnmanagedType.LPStr)] 
  string pszInitialDir;

  [MarshalAs(UnmanagedType.LPStr)] 
  string pszDefaultFileName;

  [MarshalAs(UnmanagedType.LPStr)] 
  string pszTitle;

  Int32 StillQuality;
  Int32 VideoTypes;
  Int32 nResolutionWidth;
  Int32 nResolutionHeight;
  Int32 nVideoTimeLimit;
  Int32 Mode;
}

[DllImport("aygshell.dll")]
static extern int SHCameraCapture(ref SHCAMERACAPTURE pshcc);
```
```
AFAIK, you don't need to explicitly set StructLayout on SHCAMERCAPTURE as there's nothing unusual about its layout.
Once you get this working, you might want to post your findings to pinvoke.net for others to make use of!