Basically, I am pooh pooh. Long time since I have programmed anything other than the microwave to ding in 4 minutes my ruby murry!
What I need is the code to call a program already on the device. It a very basic 2 button form.
Button1 calls \sdmmc\app1\app.exe
Button2 calls \sdmmc\app2\app.exe
**********************************
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End Sub
**********************************
I need all code, assume I know nothing (I actually don't). I am doing it in dev studio\vb\smartdeviceapplication. I tried the shell command (as per vb) but no go.
Simples - as our friend Mr Meerkat would say! THAAAAANKS (i'd even paypal a fiver to the person that gives working code)
Last edited by Ben_Stanton; 11th June 2009 at 11:37 AM.

This is how I'd do it on a big machine:
but with a CE device your mileage may vary.Code:System.Diagnostics.Process.Start("notepad")
(substitute some other process for 'notepad')
Can't take credit for this, but google can. But here c# pinvoke example which could be converted to vb.net. As some sites suggest that System.Diagnostics.Process.Start is not in winCE but that may be dated info?
Code:Duncan King For anyone who's been following this (or has the same problem) - here's the code that actually works: public class Externals { [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 ); [DllImport("CoreDll.dll")] private extern static Int32 GetLastError(); private static bool CreateProc( 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; } public static void LaunchIE() { if(!CreateProc("iexplore.exe", "http://pocketpc.msn.co.uk";, null)) { throw new Exception("Could not launch IE"); } } } public class ProcessInfo { public IntPtr hProcess; public IntPtr hThread; public Int32 ProcessId; public Int32 ThreadId; }
Wow, monkies (or is it monkeys) everywhere today!
System.Diagnostics.Process.Start does not work. Will try code above _ I couldn't find anything on the googly woogly!
Seems like lots of code just to call one app...
Thinking about it, I have visual studio so if you can write code in c# that would do too![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)