Is it ok to call CreateProcess(...) (from OpenNETCF.org WinAPI) repeatedly
with the same application as argument. I am starting peghelp.exe from
different forms (via a global class). I.e. what happens when I do this? Any
good information I could read up on?

The global method I use from different forms:
public static void ShowHelp( string tag )
{
OpenNETCF.WinAPI.Core.CreateProcess("peghelp.exe", tag);
}

regards,

Peter

Re: Calling CreateProcess repeatedly by Paul

Paul
Wed May 12 10:14:26 CDT 2004

Well, there's a limit in Windows CE on the number of running processes, so
it will fail eventually, if some of those instances don't exit. You can
probably read on MSDN some of the general information about the OS. You
don't really want to have 20 or 30 copies of peghelp running, do you?

Paul T.

"Peter B" <peter@data.se> wrote in message
news:%23zDbGKDOEHA.2740@TK2MSFTNGP11.phx.gbl...
> Is it ok to call CreateProcess(...) (from OpenNETCF.org WinAPI) repeatedly
> with the same application as argument. I am starting peghelp.exe from
> different forms (via a global class). I.e. what happens when I do this?
Any
> good information I could read up on?
>
> The global method I use from different forms:
> public static void ShowHelp( string tag )
> {
> OpenNETCF.WinAPI.Core.CreateProcess("peghelp.exe", tag);
> }
>
> regards,
>
> Peter
>
>



Re: Calling CreateProcess repeatedly by Peter

Peter
Wed May 12 10:39:57 CDT 2004

Hi Paul, thanks for your reply!

No I don't want 30 copies of peghelp running :-) I might have missed to
inform you that I am using PocketPC2003 and I was under the impression that
you can run only one instance of a application at any time?!? This may be a
.NET Compact Framework feature though, and since I am calling native code it
might not apply here...?

I could of course save the IntPtr to the first process I create and reuse
it. I'll have a look to see if there is a method that can take the IntPtr
and an argument to reuse the same PegHelp instance (something like
RecallProcess( IntPtr, argument)).

/ Peter


"Paul G. Tobey [eMVP]" <ptobey_no_spam@instrument_no_spam.com> wrote in
message news:e80hPQDOEHA.3596@tk2msftngp13.phx.gbl...
> Well, there's a limit in Windows CE on the number of running processes, so
> it will fail eventually, if some of those instances don't exit. You can
> probably read on MSDN some of the general information about the OS. You
> don't really want to have 20 or 30 copies of peghelp running, do you?
>
> Paul T.
>
> "Peter B" <peter@data.se> wrote in message
> news:%23zDbGKDOEHA.2740@TK2MSFTNGP11.phx.gbl...
> > Is it ok to call CreateProcess(...) (from OpenNETCF.org WinAPI)
repeatedly
> > with the same application as argument. I am starting peghelp.exe from
> > different forms (via a global class). I.e. what happens when I do this?
> Any
> > good information I could read up on?
> >
> > The global method I use from different forms:
> > public static void ShowHelp( string tag )
> > {
> > OpenNETCF.WinAPI.Core.CreateProcess("peghelp.exe", tag);
> > }
> >
> > regards,
> >
> > Peter
> >
> >
>
>



Re: Calling CreateProcess repeatedly by Paul

Paul
Wed May 12 10:51:02 CDT 2004

I guess that what's confusing is that I don't understand what you are really
trying to achieve. You have an instance of peghelp running and you want to
change which page is displayed by it in response to some sort of user
action?

I don't have a PPC, so I don't know what would happen, but unless the
application itself makes sure that there is only one instance of it running,
you can run as many as you have process slots and memory for, in the general
Windows CE case...

Paul T.

"Peter B" <peter@data.se> wrote in message
news:OlSeSeDOEHA.556@TK2MSFTNGP10.phx.gbl...
> Hi Paul, thanks for your reply!
>
> No I don't want 30 copies of peghelp running :-) I might have missed to
> inform you that I am using PocketPC2003 and I was under the impression
that
> you can run only one instance of a application at any time?!? This may be
a
> .NET Compact Framework feature though, and since I am calling native code
it
> might not apply here...?
>
> I could of course save the IntPtr to the first process I create and reuse
> it. I'll have a look to see if there is a method that can take the IntPtr
> and an argument to reuse the same PegHelp instance (something like
> RecallProcess( IntPtr, argument)).
>
> / Peter
>
>
> "Paul G. Tobey [eMVP]" <ptobey_no_spam@instrument_no_spam.com> wrote in
> message news:e80hPQDOEHA.3596@tk2msftngp13.phx.gbl...
> > Well, there's a limit in Windows CE on the number of running processes,
so
> > it will fail eventually, if some of those instances don't exit. You can
> > probably read on MSDN some of the general information about the OS. You
> > don't really want to have 20 or 30 copies of peghelp running, do you?
> >
> > Paul T.
> >
> > "Peter B" <peter@data.se> wrote in message
> > news:%23zDbGKDOEHA.2740@TK2MSFTNGP11.phx.gbl...
> > > Is it ok to call CreateProcess(...) (from OpenNETCF.org WinAPI)
> repeatedly
> > > with the same application as argument. I am starting peghelp.exe from
> > > different forms (via a global class). I.e. what happens when I do
this?
> > Any
> > > good information I could read up on?
> > >
> > > The global method I use from different forms:
> > > public static void ShowHelp( string tag )
> > > {
> > > OpenNETCF.WinAPI.Core.CreateProcess("peghelp.exe", tag);
> > > }
> > >
> > > regards,
> > >
> > > Peter
> > >
> > >
> >
> >
>
>



Re: Calling CreateProcess repeatedly by Alex

Alex
Wed May 12 11:05:48 CDT 2004

Most "well-designed" Pocket PC applications will simply check for a running
instance upon startup and activate it then exit. So, no harm should be in
launching the process repeatedly. With peghelp, this is probably the only
way to ensure the parameters are passed correctly to the running instance
too

--
Alex Feinman
---
Visit http://www.opennetcf.org
"Peter B" <peter@data.se> wrote in message
news:%23zDbGKDOEHA.2740@TK2MSFTNGP11.phx.gbl...
> Is it ok to call CreateProcess(...) (from OpenNETCF.org WinAPI) repeatedly
> with the same application as argument. I am starting peghelp.exe from
> different forms (via a global class). I.e. what happens when I do this?
Any
> good information I could read up on?
>
> The global method I use from different forms:
> public static void ShowHelp( string tag )
> {
> OpenNETCF.WinAPI.Core.CreateProcess("peghelp.exe", tag);
> }
>
> regards,
>
> Peter
>
>



Re: Calling CreateProcess repeatedly by Peter

Peter
Wed May 12 11:15:15 CDT 2004

In the case of peghelp.exe this is perfectly safe. The application only
allows one running instance and will switch to the file/topic specified in
the argument. This is a perfectly acceptable (only way) of programmatically
bringing up different help topics based on the context of your application -
native applications will do just the same.

For example you may use a different topic per form, or store the topic name
in a variable which you can change based on the current options set by the
user. How you choose this depends entirely on your requirements. If you pass
in the topic name which is currently open in peghelp, then you will bring
the help window to the front.

Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

"Paul G. Tobey [eMVP]" <ptobey_no_spam@instrument_no_spam.com> wrote in
message news:u269cnDOEHA.3300@TK2MSFTNGP09.phx.gbl...
>I guess that what's confusing is that I don't understand what you are
>really
> trying to achieve. You have an instance of peghelp running and you want
> to
> change which page is displayed by it in response to some sort of user
> action?
>
> I don't have a PPC, so I don't know what would happen, but unless the
> application itself makes sure that there is only one instance of it
> running,
> you can run as many as you have process slots and memory for, in the
> general
> Windows CE case...
>
> Paul T.
>
> "Peter B" <peter@data.se> wrote in message
> news:OlSeSeDOEHA.556@TK2MSFTNGP10.phx.gbl...
>> Hi Paul, thanks for your reply!
>>
>> No I don't want 30 copies of peghelp running :-) I might have missed to
>> inform you that I am using PocketPC2003 and I was under the impression
> that
>> you can run only one instance of a application at any time?!? This may be
> a
>> .NET Compact Framework feature though, and since I am calling native code
> it
>> might not apply here...?
>>
>> I could of course save the IntPtr to the first process I create and reuse
>> it. I'll have a look to see if there is a method that can take the IntPtr
>> and an argument to reuse the same PegHelp instance (something like
>> RecallProcess( IntPtr, argument)).
>>
>> / Peter
>>
>>
>> "Paul G. Tobey [eMVP]" <ptobey_no_spam@instrument_no_spam.com> wrote in
>> message news:e80hPQDOEHA.3596@tk2msftngp13.phx.gbl...
>> > Well, there's a limit in Windows CE on the number of running processes,
> so
>> > it will fail eventually, if some of those instances don't exit. You
>> > can
>> > probably read on MSDN some of the general information about the OS.
>> > You
>> > don't really want to have 20 or 30 copies of peghelp running, do you?
>> >
>> > Paul T.
>> >
>> > "Peter B" <peter@data.se> wrote in message
>> > news:%23zDbGKDOEHA.2740@TK2MSFTNGP11.phx.gbl...
>> > > Is it ok to call CreateProcess(...) (from OpenNETCF.org WinAPI)
>> repeatedly
>> > > with the same application as argument. I am starting peghelp.exe from
>> > > different forms (via a global class). I.e. what happens when I do
> this?
>> > Any
>> > > good information I could read up on?
>> > >
>> > > The global method I use from different forms:
>> > > public static void ShowHelp( string tag )
>> > > {
>> > > OpenNETCF.WinAPI.Core.CreateProcess("peghelp.exe", tag);
>> > > }
>> > >
>> > > regards,
>> > >
>> > > Peter
>> > >
>> > >
>> >
>> >
>>
>>
>
>



Re: Calling CreateProcess repeatedly by Peter

Peter
Wed May 12 11:41:05 CDT 2004

Thanks for the replies Alex and Peter!

So now I know this way of calling peghelp should be safe, now to the
"actual" problem :)

I think I will create a new thread for this as there is quite a lot of
information and the topic is slightly different. Please read "What does this
error mean?"

thanks again guys!!

// Peter


"Peter Foot [MVP]" <feedback@nospam-inthehand.com> wrote in message
news:%23zuiOxDOEHA.1616@TK2MSFTNGP12.phx.gbl...
> In the case of peghelp.exe this is perfectly safe. The application only
> allows one running instance and will switch to the file/topic specified in
> the argument. This is a perfectly acceptable (only way) of
programmatically
> bringing up different help topics based on the context of your
application -
> native applications will do just the same.
>
> For example you may use a different topic per form, or store the topic
name
> in a variable which you can change based on the current options set by the
> user. How you choose this depends entirely on your requirements. If you
pass
> in the topic name which is currently open in peghelp, then you will bring
> the help window to the front.
>
> Peter
>
> --
> Peter Foot
> Windows Embedded MVP
> www.inthehand.com | www.opennetcf.org
>
> "Paul G. Tobey [eMVP]" <ptobey_no_spam@instrument_no_spam.com> wrote in
> message news:u269cnDOEHA.3300@TK2MSFTNGP09.phx.gbl...
> >I guess that what's confusing is that I don't understand what you are
> >really
> > trying to achieve. You have an instance of peghelp running and you want
> > to
> > change which page is displayed by it in response to some sort of user
> > action?
> >
> > I don't have a PPC, so I don't know what would happen, but unless the
> > application itself makes sure that there is only one instance of it
> > running,
> > you can run as many as you have process slots and memory for, in the
> > general
> > Windows CE case...
> >
> > Paul T.
> >
> > "Peter B" <peter@data.se> wrote in message
> > news:OlSeSeDOEHA.556@TK2MSFTNGP10.phx.gbl...
> >> Hi Paul, thanks for your reply!
> >>
> >> No I don't want 30 copies of peghelp running :-) I might have missed to
> >> inform you that I am using PocketPC2003 and I was under the impression
> > that
> >> you can run only one instance of a application at any time?!? This may
be
> > a
> >> .NET Compact Framework feature though, and since I am calling native
code
> > it
> >> might not apply here...?
> >>
> >> I could of course save the IntPtr to the first process I create and
reuse
> >> it. I'll have a look to see if there is a method that can take the
IntPtr
> >> and an argument to reuse the same PegHelp instance (something like
> >> RecallProcess( IntPtr, argument)).
> >>
> >> / Peter
> >>
> >>
> >> "Paul G. Tobey [eMVP]" <ptobey_no_spam@instrument_no_spam.com> wrote in
> >> message news:e80hPQDOEHA.3596@tk2msftngp13.phx.gbl...
> >> > Well, there's a limit in Windows CE on the number of running
processes,
> > so
> >> > it will fail eventually, if some of those instances don't exit. You
> >> > can
> >> > probably read on MSDN some of the general information about the OS.
> >> > You
> >> > don't really want to have 20 or 30 copies of peghelp running, do you?
> >> >
> >> > Paul T.
> >> >
> >> > "Peter B" <peter@data.se> wrote in message
> >> > news:%23zDbGKDOEHA.2740@TK2MSFTNGP11.phx.gbl...
> >> > > Is it ok to call CreateProcess(...) (from OpenNETCF.org WinAPI)
> >> repeatedly
> >> > > with the same application as argument. I am starting peghelp.exe
from
> >> > > different forms (via a global class). I.e. what happens when I do
> > this?
> >> > Any
> >> > > good information I could read up on?
> >> > >
> >> > > The global method I use from different forms:
> >> > > public static void ShowHelp( string tag )
> >> > > {
> >> > > OpenNETCF.WinAPI.Core.CreateProcess("peghelp.exe", tag);
> >> > > }
> >> > >
> >> > > regards,
> >> > >
> >> > > Peter
> >> > >
> >> > >
> >> >
> >> >
> >>
> >>
> >
> >
>
>