Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Non-Exit Application

Posted on 2004-09-03
3
Medium Priority
?
236 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

618 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