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
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