Solved

Non-Exit Application

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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 designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

943 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

7 Experts available now in Live!

Get 1:1 Help Now