+ Post New Thread
Results 1 to 5 of 5
Coding Thread, Anybody know anything about wince programming? in Coding and Web Development; Basically, I am pooh pooh. Long time since I have programmed anything other than the microwave to ding in 4 ...
  1. #1
    Ben_Stanton's Avatar
    Join Date
    Jan 2007
    Location
    Hertfordshire
    Posts
    443
    Thank Post
    9
    Thanked 15 Times in 14 Posts
    Rep Power
    18

    Anybody know anything about wince programming?

    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 10:37 AM.

  2. #2

    powdarrmonkey's Avatar
    Join Date
    Feb 2008
    Location
    Alcester, Warwickshire
    Posts
    4,859
    Thank Post
    412
    Thanked 777 Times in 650 Posts
    Rep Power
    182
    This is how I'd do it on a big machine:

    Code:
    System.Diagnostics.Process.Start("notepad")
    but with a CE device your mileage may vary.


    (substitute some other process for 'notepad')

  3. #3
    monkeyx's Avatar
    Join Date
    Nov 2006
    Posts
    364
    Thank Post
    8
    Thanked 52 Times in 41 Posts
    Rep Power
    25
    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;
    }

  4. #4
    Ben_Stanton's Avatar
    Join Date
    Jan 2007
    Location
    Hertfordshire
    Posts
    443
    Thank Post
    9
    Thanked 15 Times in 14 Posts
    Rep Power
    18
    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...

  5. #5
    Ben_Stanton's Avatar
    Join Date
    Jan 2007
    Location
    Hertfordshire
    Posts
    443
    Thank Post
    9
    Thanked 15 Times in 14 Posts
    Rep Power
    18
    Thinking about it, I have visual studio so if you can write code in c# that would do too

SHARE:
+ Post New Thread

Similar Threads

  1. Simple Programming
    By somabc in forum Windows
    Replies: 9
    Last Post: 11th February 2009, 01:13 PM
  2. Programming Advice
    By Michael in forum Coding
    Replies: 19
    Last Post: 2nd February 2009, 03:08 PM
  3. [News] Could You Explain Programming Please
    By mattx in forum Jokes/Interweb Things
    Replies: 4
    Last Post: 25th November 2008, 06:16 PM
  4. VB LAN programming
    By illya in forum Coding
    Replies: 7
    Last Post: 10th October 2008, 05:10 PM
  5. KidBASIC - Programming for Kids
    By Geoff in forum Downloads
    Replies: 8
    Last Post: 13th December 2006, 12:46 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •