This is the mail archive of the mailing list for the Cygwin 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: SetConsoleCtrlHandler problem

> From: Michi Henning
> Sent: Wednesday, December 31, 2003 4:39 AM

> #include <Windows.h>
> #include <iostream>
> static BOOL handler(DWORD sig)
> {
>      std::cout << "handler called" << std::endl;
>      return 1;
> }
> int main()
> {
>      SetConsoleCtrlHandler((PHANDLER_ROUTINE)handler, true);
>      for(;;)
> 	;
>      return 0;
> }

FWIW, my WAG, $0.02...

 I'd expect this to be a bit dependent on whether you use the -mno-cygwin
flag or not... Or am I totally out in the blue here? (I'm curious, please
elaborate if you can!)

 Michi, how *did you* compile it?

 Your code looks as it should be compiled _with_ -mno-cygwin; not much POSIX
code as it seems to me. What happens if you feed this to cygwin1.dll/cygwin
runtime routines -> interference?

Using "-mno-cygwin" -> cygwin1.dll not involved -> expect more
"windows"-like or compatible handling of stuff like this.

/Hannu E K Nevalainen, B.Sc. EE - 59+16.37'N, 17+12.60'E

** on a mailing list; please keep replies on that particular list **

-- printf("LocalTime: UTC+%02d\n",(DST)? 2:1); --

Unsubscribe info:
Problem reports:

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