Solved

Non-Exit Application

Posted on 2004-09-03
3
213 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
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

808 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