Hello everyone, I have a console program that I created, it works fine but I would use some help to solve two puzzles that I seem to be facing.
Basically my code looks like this..
1 2 3 4 5 6
|
void MainHandler
{
Initialize(/*some flags here*/);/// this are my basic function but my real program uses a switch
Update(); /// to call them based on my selection.
Review();
}
|
Nb: any of the three functions can run for a really long time that's why I would like to have a way of interrupting them, i also have no idea on windows programming if that helps.
Q1. my update function basically runs if I have added new files to the default directory but I usually do this update manually and mainly by restarting my app and selecting the update function, I would really love to have another function that will run auto when update is called check if I have added new files , if so the update continues else it returns.
Note that all file have the same extension
.dtx
Q2.my initialize function loads data from files into a primitive database and then it proceeds to a processing stage which can usually take sometime
I would love to have a function like
listener(char&)
such that if I press 'u' on my keyboard during the processing stage, my program would call the update function instantly , if I do the same with 'r' it would call the review function. ...
IS THIS POSSIBLE...
Any help will be greatlly appreciated,
Cheers Andy.