How do you stop a second instance of a procedure ????? 
Author Message
 How do you stop a second instance of a procedure ?????

Hi,

I have a "control panel" that is a MDI window, but I only want to have
it opened the once.

I had considered setting a global variable when the first instance takes
place, and then reseting it when the window closes, so that this global
variable can be used to prevent a second instance from taking place.

Is there any better ways of doing it. The window must remain MDI.

Thanks

Tony

--
Tony York
Fiscal Software
Perth Western Australia

http://www.*-*-*.com/



Sun, 10 Mar 2002 03:00:00 GMT  
 How do you stop a second instance of a procedure ?????
Hi tony,

Here are some places to look for all kinds of Clarion related stuff.

www.topspeed.com
www.icetips.com
www.par2.com
www.cwicweb.com.
http://www.netins.net/showcase/tomruby/clarion/

You might also try www.clarionmag.com since it is an ezine for Clarion with
info for learning but it costs a nominal fee to get the good stuff.<g>

Regards,
Earl


Quote:
> Hi,

> I have a "control panel" that is a MDI window, but I only want to have
> it opened the once.

> I had considered setting a global variable when the first instance takes
> place, and then reseting it when the window closes, so that this global
> variable can be used to prevent a second instance from taking place.

> Is there any better ways of doing it. The window must remain MDI.

> Thanks

> Tony

> --
> Tony York
> Fiscal Software
> Perth Western Australia

> http://www.fiscal.com.au



Sun, 10 Mar 2002 03:00:00 GMT  
 How do you stop a second instance of a procedure ?????
Hi Tony

Quote:
> I have a "control panel" that is a MDI window, but I only want to have
> it opened the once.

> I had considered setting a global variable when the first instance takes
> place, and then reseting it when the window closes, so that this global
> variable can be used to prevent a second instance from taking place.

> Is there any better ways of doing it. The window must remain MDI.

IMO it's the best way to handle that.

Create a global ulong variable named ie Glo_MyPanel

On your menu item don't let the template start your procedure - go instead
to the accepted embed and:

If Glo_MyPanel        !// already open
  Post(Event:GainFocus,,Glo_MyPanel)      !// Make it active again
Else                            !// not open
  Glo_MyPanel = Start(MyPanelProcedure)    !// start the procedure
End

In the CloseWindow embed of your panel Procedure insert:
Glo_MyPanel = 0

and in the gainfocus embed insert
0{Prop:Active} = True

For further details check out the Start command in the Help.

By the way there is a template around (forgot the name - ThreadLimiter?)
that does this automatically for you...

HTH
Hanspeter Stutz
ARCO Software



Sun, 10 Mar 2002 03:00:00 GMT  
 How do you stop a second instance of a procedure ?????
According to Topspeed Turnpike (wonderfully useful webpage) :
http://www.netins.net/showcase/tomruby/clarion/#Utilities

Boxsoft has a template that
"Limit Procedure Starts to One Thread" :
http://www.boxsoftdevelopment.com/

Princen has a template that
"FREE thread limiter"
http://www.princen-it.nl/Clarion/

There is also a
"U-Beat4 Thread Manager 6 NOV 1998 Demo" available from:
ftp://ftp.bmtmicro.com/bmtmicro/UB4demo.zip.

But for a single procedure your way is probably simplest.

Stephen Fulton.



Quote:
> Hi,

> I have a "control panel" that is a MDI window, but I only want to have
> it opened the once.

> I had considered setting a global variable when the first instance
takes
> place, and then reseting it when the window closes, so that this
global
> variable can be used to prevent a second instance from taking place.

> Is there any better ways of doing it. The window must remain MDI.

> Thanks

> Tony

> --
> Tony York
> Fiscal Software
> Perth Western Australia

> http://www.fiscal.com.au

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


Mon, 11 Mar 2002 03:00:00 GMT  
 How do you stop a second instance of a procedure ?????
Thanks,

You have been most helpful.....

Tony

Quote:

> Hi Tony

> > I have a "control panel" that is a MDI window, but I only want to have
> > it opened the once.

> > I had considered setting a global variable when the first instance takes
> > place, and then reseting it when the window closes, so that this global
> > variable can be used to prevent a second instance from taking place.

> > Is there any better ways of doing it. The window must remain MDI.

> IMO it's the best way to handle that.

> Create a global ulong variable named ie Glo_MyPanel

> On your menu item don't let the template start your procedure - go instead
> to the accepted embed and:

> If Glo_MyPanel        !// already open
>   Post(Event:GainFocus,,Glo_MyPanel)      !// Make it active again
> Else                            !// not open
>   Glo_MyPanel = Start(MyPanelProcedure)    !// start the procedure
> End

> In the CloseWindow embed of your panel Procedure insert:
> Glo_MyPanel = 0

> and in the gainfocus embed insert
> 0{Prop:Active} = True

> For further details check out the Start command in the Help.

> By the way there is a template around (forgot the name - ThreadLimiter?)
> that does this automatically for you...

> HTH
> Hanspeter Stutz
> ARCO Software

--
Tony York
Fiscal Software
Perth Western Australia

http://www.fiscal.com.au


Mon, 11 Mar 2002 03:00:00 GMT  
 How do you stop a second instance of a procedure ?????
Tintools has the facility to only open an MDI window once....and it's free
:-)

Bryan


Quote:
> Hi,

> I have a "control panel" that is a MDI window, but I only want to have
> it opened the once.

> I had considered setting a global variable when the first instance takes
> place, and then reseting it when the window closes, so that this global
> variable can be used to prevent a second instance from taking place.

> Is there any better ways of doing it. The window must remain MDI.

> Thanks

> Tony

> --
> Tony York
> Fiscal Software
> Perth Western Australia

> http://www.fiscal.com.au



Mon, 11 Mar 2002 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. STOP doesn't stop this procedure [TECHNICAL]

2. stop running procedure/lock procedure

3. Stop doing Regina development!!

4. STOP what you’re doing - It doesn’t work! 25RA

5. Second user/instance of a program - POOR performance

6. Error produced on second instance of the same code (PHP/MySQL related)

7. Detecting second instance of a program in NT!

8. stopping a thread instance

9. instances of classes and instances of instances

10. menu cloning procedure is very slow: 2-3 seconds per complex menu

11. STOP - Built-in procedure

12. Stopping Execution of A Procedure

 

 
Powered by phpBB® Forum Software