Problem with CreateProcess and Menus

M

Mustafa Rabie

Hi All,

I am writing an application that i use to execute other applications from
with it. I used the code that came with CompactNav sample for
CreateProcess:

//class for PROCESSINFO struct pinvoke
public class ProcessInfo
{
public IntPtr hProcess;
public IntPtr hThread;
public Int32 ProcessId;
public Int32 ThreadId;
}
// protoytpe for platform-invoked CreateProcess call
[DllImport("CoreDll.DLL", SetLastError=true)]
private extern static
int CreateProcess( String imageName,
String cmdLine,
IntPtr lpProcessAttributes,
IntPtr lpThreadAttributes,
Int32 boolInheritHandles,
Int32 dwCreationFlags,
IntPtr lpEnvironment,
IntPtr lpszCurrentDir,
byte [] si,
ProcessInfo pi );

// CreateProcess wrapper
public static bool CreateProcess( String ExeName, String
CmdLine, ProcessInfo pi )
{
if ( pi == null )
pi = new ProcessInfo();

byte [] si = new byte[128];

return CreateProcess(ExeName, CmdLine, IntPtr.Zero,
IntPtr.Zero,
0, 0, IntPtr.Zero, IntPtr.Zero, si, pi) != 0;
}

if i add a menu and submenus i get the following error message when setting
the name of the form in the initcomponents function: this.Text = "Form1"

An unhandled exception of type 'System.NotSupportedException' occurred in
System.Windows.Forms.dll

Additional information: NotSupportedException

if i just add 1 menu item it works fine, anyone knows what the problem might
be or if theres another wrapper that i can use?

Thanks
Mustafa
 
A

Alex Yakhnin [MVP]

Make sure that you're not adding menu items to the left menu on the
smartphone.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top