Solved

Non-Exit Application

Posted on 2004-09-03
3
189 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
3 Comments
 
LVL 16

Accepted Solution

by:
nonubik earned 100 total points
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now