?
Solved

Non-Exit Application

Posted on 2004-09-03
3
Medium Priority
?
234 Views
Last Modified: 2010-04-24
Hi
I have an application with imports text file to SQL Server, where the text files will be uploaded to a particular folder.(it may be empty without text file also).

Now, my application searches this folder and converts text file to SQL Server Rows if text file exists Or else it keeps searching the folder.

Iam maintaning a log file for errors, where i come to know what happened and when @ what time.

The problem is my application EXIT... I dont want my application to EXIT, it must run 24/7.

Please suggest some idea and a piece of code coz am little new to VC++, so that i can handle this.

regards
0
Comment
Question by:raghx_2000
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 16

Accepted Solution

by:
nonubik earned 400 total points
ID: 11980539
You can create a thread where you do your search stuff, in an 'infinite' loop that will stop on an external event. Like you have a bool value that you set it when the wile loop wants to be finished. This bool val can be set from outside the thread (e.g. whe someone push a 'stop' button).

while(1)
{
  if(bExit)
    break;
 
  //process your search

  Sleep(1);
}

0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question