BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TmainMenu

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Using
View previous topic :: View next topic  
Author Message
Jens Munk
Guest





PostPosted: Tue Oct 28, 2003 10:12 pm    Post subject: TmainMenu Reply with quote



In this application I have a loop always running (checking some external
hardware) but when I pull down a menu from TMainMenu the loop stops until I
click the menu item. I know the same thing happens in e.g. visual basic, but
is there any way of keeping my loop running while the menu is pulled down?

The obvious suggestion would be to put the loop in a separate thread but I
don't want to do that for other reasons.

Thanks,

Jens.


Back to top
Jon Jacobs
Guest





PostPosted: Tue Oct 28, 2003 11:31 pm    Post subject: Re: TmainMenu Reply with quote



Put your loop in a separate thread.
Jon

"Jens Munk" <j.munk (AT) maccor (DOT) dk> wrote

Quote:
In this application I have a loop always running (checking some external
hardware) but when I pull down a menu from TMainMenu the loop stops until
I
click the menu item. I know the same thing happens in e.g. visual basic,
but
is there any way of keeping my loop running while the menu is pulled down?

The obvious suggestion would be to put the loop in a separate thread but I
don't want to do that for other reasons.

Thanks,

Jens.





Back to top
Kurt Barthelmess
Guest





PostPosted: Wed Oct 29, 2003 12:52 am    Post subject: Re: TmainMenu Reply with quote



"Jens Munk" <j.munk (AT) maccor (DOT) dk> wrote:

Quote:
In this application I have a loop always running (checking some external
hardware) but when I pull down a menu from TMainMenu the loop stops until I
click the menu item. I know the same thing happens in e.g. visual basic, but
is there any way of keeping my loop running while the menu is pulled down?

What are you doing now to keep this loop running? Calling
Application.ProcessMessages in between times?

I don't know of any elegant solutions. The problem is that once you
surrender control be that call to ProcessMessages, you are stuck until
that menu closes. You can still get messages, however (this is the not
so elegant solution<g>), so if you restructure your code so that it
does a "chunk" of stuff in response to an event like a timer or an
OnIdle event, it can continue to grind.

Good luck.

Kurt


Back to top
Jens Munk
Guest





PostPosted: Wed Oct 29, 2003 5:45 am    Post subject: Re: TmainMenu Reply with quote

Thanks Kurt,

Comments inserted below,

Jens.

Quote:

What are you doing now to keep this loop running? Calling
Application.ProcessMessages in between times?

==>A couple of things: The application was written in Visual Basic when I
took over and I am now in the process of migrating to Delphi. So in the VB
application a timer is started when the menu is started as you suggest
below. In Delphi I have detached the user interface from the core grinding
part of the program into a separate application mainly to get remote
operation. So really I do not desparately need a menu in the "server"
application since I can just use a few buttons. Currently just three
functions are needed: One to setup user rights, one to call a maintenance
screen and one to shut down.

Quote:

I don't know of any elegant solutions. The problem is that once you
surrender control be that call to ProcessMessages, you are stuck until
that menu closes. You can still get messages, however (this is the not
so elegant solution<g>), so if you restructure your code so that it
does a "chunk" of stuff in response to an event like a timer or an
OnIdle event, it can continue to grind.

==>I will just go for plain buttons instead then. I want my server
application to be lean, clean and solid. The reason for my question Is that
I just wanted to be 100% sure that I wasn't missing something to get it
working in a simple way, but apparently I am not.

Quote:

Good luck.

Kurt




Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Using All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.