Forum > PDAs and Smartphones

How to start another application in WinCE

(1/3) > >>

AndieSphinx:
Hi all,

my previous topic has disappeared somehow, so I need to ask again:

I have program on PDA, and want to start another one (notes.exe, calculator.exe, or anything) with a buttonclick.
I'm using ShellExecute, but the windows on the PDA says : There is no application associated with "notes.exe"
Btw, I don't want to associate anything, I just want WindowsCE to start this another application, if I ask it.

Any idea? :roll:

felipemdc:
Use the cross-platform TProcess;

http://wiki.lazarus.freepascal.org/Executing_External_Programs

AndieSphinx:
Hi Sekel!

Thanx for the answer, I tried to used this, but unfortunately I got an error:
"Failed to execute \Windows\hello.exe" : 87.

Both starter.exe and hello.exe is in the same directory, in \Windows on my PDA. Hello.exe can be started manually, and works fine. (does nothing, only a form and a button).

My source is:


--- Code: ---
var
  Form1: TForm1;
  AProcess: TProcess;

implementation

{ TForm1 }

procedure TForm1.Button1Click(Sender: TObject);
var
 appath: string;
begin
  AProcess := TProcess.Create(nil);
  appath:=ExtractFilepath(application.exename);
  AProcess.CommandLine := appath+'hello.exe';
  AProcess.Options := AProcess.Options + [poWaitOnExit];
  AProcess.Execute;
  AProcess.Free;
end;

--- End code ---


I already tried without the WaitOnExit and Free, only execute, the result is the same :(

Any idea, why am I unable to run my own program?

felipemdc:
I donĀ“t know. Search microsoft website and google to find out what this error means. Try both the error code and the error string.

AndieSphinx:
Hey!!!
  SysUtils.ExecuteProcess(appath+'hello.exe',[]);
is working!!! :)))

Btw, I'll check microsoft regarding why TProcess-stlye doesn't work...

Thanks Sekel!

Navigation

[0] Message Index

[#] Next page

Go to full version