Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wake up 2nd program from Sleep

Status
Not open for further replies.

SprintFlunky

Programmer
Apr 6, 2004
51
US
I have a Windows Form app with no user interface that spins through Outlook checking for specific emails. It processes attached text files into an Oracle database abd put's log entries into a text file as appropriate. I have a System.Threading.Thread.Sleep(SleepSeconds * 1000) statement to put the program to sleep for x seconds. All interfacing is performed through variables in the Registry including the primary loop controller. When the program wakes up, it reads the registry to see if the user changed the sleep seconds or wants it to exit

All of that works great. I created a second interface program that reads the Registry and Log information to tell the user how many emails processed and current status. They also have the Seconds and Exit variables to update the registry. That also works great.

What I want is a way to wake up the first program when the user updates the Registry to terminate so he does not have to wait until the sleep cycle is complete.

I thought about threads, but I don't want the interface program running unless the user requests it.

I can get access to the program objProcess but I don't know how to issue a Thread.Start command on the sleeping program.

Any Ideas?

 
Thread. Start won't work because the thread is already started. Your best bet may be just killing the process. Never done so myself, but I think I remember it being talked about a while ago. If not that, you may be able to remote into the primary app and call a public function, but I have about nada experience on remoting. Sorry I can't be more help.

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top