This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Alarm callbacks on Windows with Gnu or MinGW?
- From: Brian Dessent <brian at dessent dot net>
- To: Dana Good <dpgood at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Wed, 07 Mar 2007 15:18:23 -0800
- Subject: Re: Alarm callbacks on Windows with Gnu or MinGW?
- References: <f0984dfa0703071446wf0194eeua346c935c4754f1a@mail.gmail.com>
- Reply-to: gcc-help at gcc dot gnu dot org
Dana Good wrote:
> Please excuse me if this is the wrong location for this post - I
> looked long and hard before I posted, and would be happy to be
> redirected!
You'd get better responses on the MinGW list.
> I am using C++ in Eclipse with CDT and MinGW on a Windows machine.
> I'd prefer not to use VC++.
>
> I would like to implement a simple alarm callback, a la 'C', where I
> set a timer to go off and use a signal catcher to catch the
> interrupt/exception/signal/whatever.
For this you need to use the Win32 API. See for example
CreateWaitableTimer(), SetWaitableTimer(), WaitForSingleObject(),
CreateThread/_beginthreadex and so on. See MSDN for details, or the
platform SDK.
http://msdn2.microsoft.com/en-us/library/ms681924(VS.85).aspx
http://msdn2.microsoft.com/en-us/library/ms686967(VS.85).aspx
etc.
> My Googles have left me fairly convinced that I can't do this without
> including the VC++ libraries - is this true?
These are the APIs provided by the operating system; they have nothing
to do with Visual C++. The w32api package includes all the import
libraries necessary to link against any of these Win32 API dlls.
Brian