Solved

TSR in MS VC++ 6.0 based on Timer Interrupt

Posted on 2000-02-14
3
530 Views
Last Modified: 2008-02-01
I would like to write a TSR that would
check for existence of a file in a given
path every "5 minutes" and then do some
action based on it. I am using Pro*C
to connect to Oracle to perform the action.
So my interrupt should be based on the timer.

I am using MS VC++ to do the C coding and precompiling with Pro*C and then compile and link in VC++.

Could anyone give me a sample code based on the timer interrupt ?
0
Comment
Question by:karthikesh
[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
  • 2
3 Comments
 
LVL 22

Accepted Solution

by:
nietod earned 100 total points
ID: 2519693
VC cannot generate TSRs.  TSRs must be DOS programs.

>> sample code based on the timer interrupt ?
You can't do this from VC.

But you could jsu create a windows program to do this.

Create a window for the program and hide it.  The use SetTimer() to create timer messages so your program can "wake up" and perform the checks when needed.   (You must have the window or the SetTimer() won't work, as it needs to send messages to a window, but you can hide the window if you don't want it.)

Let me know if you have any questions.
0
 

Author Comment

by:karthikesh
ID: 2520729
How to create a window "for this prog."?
Should SetTimer() be part of my prog.?
And will the timer cycle indefinitely for n times or is it just 1 time.
Could you please provide a framework ?
0
 
LVL 22

Expert Comment

by:nietod
ID: 2521005
Those questions seem to be way beyond the scope of a single 100 points question.  

These are basic windows programming issues.  Do you know windows programing?, how to create windows, how to handle messages?

If not you need to get a book on windows programming, like "Programming Windows" by Charles Petzold.  After you understanad it you will be in much better shape to ask questions here.  (We can't be expected to answer questions that require 100s of pages of text and have been already answered in books, and undoubtably better answered too.)

If you know windows programming, then you can just create the window as usual and hide it with ShowWindow() using SW_HIDE.  You create the timer with SetTimer().  It will send you WM_TIMER messages at the interval you specify (ever 5 miutes).  The timer continues doing so until you destroy it with Killtimer().
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

690 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