Re: Alarm callbacks on Windows with Gnu or MinGW?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux