Solved

Equivalent of alram() call in VC++?

Posted on 1998-02-07
6
198 Views
Last Modified: 2010-04-10
Hi,

Is there any function call similar to unix alram call in VC++ on Win 95 system. I need to use it to terminate a program which hangs. If not is there a work around for this.
0
Comment
Question by:bagalp
6 Comments
 
LVL 3

Expert Comment

by:q2guo
ID: 1181098
I think raise() is the function you are looking for

<signal.h>
int raise( int sig )

0
 

Author Comment

by:bagalp
ID: 1181099
I want a function call which can be used to time out the program which calls it. Using raise() I will need another process to keep track of this process. raise() is equivalent to a signal() call in UNIX. Here I have a program which potentially hangs. So I need something using which I can time out this program. That is equivalent of alram() call in unix.

Sorry if I was not clear during my first question.
0
 
LVL 7

Expert Comment

by:galkin
ID: 1181100
Create another thread with higher priority which would spy main thread and if it sees main thread has hung it will terminate it.

0
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.

 

Author Comment

by:bagalp
ID: 1181101
Thanks for the work around.

Does this mean that VC++ has no concept of timing out an application.



0
 
LVL 32

Accepted Solution

by:
jhance earned 200 total points
ID: 1181102
If you need to time out after a specified period of time, use a timer (SetTimer() function).  When the time fires, you application will get a message and you can do whatever it is that needs to be done.  
0
 

Author Comment

by:bagalp
ID: 1181103
OK that's something that will give me some control over the application.

Thanks for your time.
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

Suggested Solutions

Title # Comments Views Activity
getting a fire fox page (view page source ) in c++ 6 42
Grammars for C C++ and java 1 113
White board coding practice 3 77
Error C2678: binary '!=': no operator found... 4 41
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
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 learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

930 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

9 Experts available now in Live!

Get 1:1 Help Now