Best way to start a process from .net cf app?

J

juvi

hello,

usually when I am starting an application/process through my .net cf
application I use the following:

system.diagnostics.process.start(...);

But the applications seems to take longer to start - is this correct?
I saw also the following way (are there advantages in using this one?):

ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = "...";
startInfo.Arguments = "...";
Process.Start(startInfo);

thank you in advance.
 
J

Jesse Houwing

Hello juvi,
hello,

usually when I am starting an application/process through my .net cf
application I use the following:

system.diagnostics.process.start(...);

But the applications seems to take longer to start - is this correct?
I saw also the following way (are there advantages in using this
one?):

ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = "...";
startInfo.Arguments = "...";
Process.Start(startInfo);
thank you in advance.

It's exactly the same as far as I know. s.d.Process.Start() creates it's
own startinfo and passes that to the process.Start method internally.

When do applications seem longer to start is my question though... longer
than when you start them from the start menu?

It shouldn't really make any difference...
 
I

Ignacio Machin ( .NET/ C# MVP )

hello,

usually when I am starting an application/process through my .net cf
application I use the following:

system.diagnostics.process.start(...);

But the applications seems to take longer to start - is this correct?
I saw also the following way (are there advantages in using this one?):

ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = "...";
startInfo.Arguments = "...";
Process.Start(startInfo);

thank you in advance.

Hi,

No, it's the way to go.
Question, longer than when?
 
P

Paul G. Tobey [eMVP]

Not much longer. I suppose that the first time in a managed application
that you P/Invoke CreateProcess() it might, conceivably take slightly longer
to get the address of the CreateProcess call, adjust the parameters to fit
the calling convention that you specify, etc., but that's going to be
measureed in microseconds or, maybe, milliseconds, not seconds. If you're
seeing that sort of difference, you or the overall system are responsible,
not the .NET CF. Maybe in one case, the application is loaded, but
smart-minimized? While in the other case, the application has to actually
be loaded and started (and maybe that application has a long process to
initialize on the first start?

Paul T.
 

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