This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Alarm callbacks on Windows with Gnu or MinGW?


Many thanks!

On 3/7/07, Brian Dessent <brian@dessent.net> wrote:
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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]