?
Solved

TSR in MS VC++ 6.0 based on Timer Interrupt

Posted on 2000-02-14
3
Medium Priority
?
532 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 200 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

800 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