From: SourceForge.net <no...@so...> - 2005-06-18 07:57:23
|
Bugs item #1174724, was opened at 2005-04-01 21:56 Message generated for change (Settings changed) made by dannysmith You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1174724&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: w32api Group: None >Status: Closed >Resolution: Wont Fix Priority: 5 Submitted By: Joachim Hönig (jhoenig) Assigned to: Nobody/Anonymous (nobody) Summary: Including windows headers breaks <someclass>::GetMessage() Initial Comment: from winuser.h: WINUSERAPI BOOL WINAPI GetMessageA(LPMSG, HWND,UINT,UINT); and later: #define GetMessage GetMessageA If you happen to use a class with a member function named GetMessage(), the compiler will fail, complaining about a missing GetMessageA() function, as soon as the Windows API headers are included. Replacing the above macro with an inline function definition fixes this (at no cost): inline BOOL GetMessage(LPMSG A, HWND B, UINT C, UINT D) { GetMessageA(A, B, C, D); } IMHO this scheme should be applied to all Windows API headers. I can imagine a perl script or the like could do this automagically. ---------------------------------------------------------------------- Comment By: Luke Dunstan (infidel) Date: 2005-04-03 18:44 Message: Logged In: YES user_id=30442 That won't work for C code, and it is undesirable to start introducing new differences between the way our headers work with C and C++. These macros are also present in other Windows compilers so changing them could introduce incompatibilities there too (some code may rely on the macros existing). As far as I'm concerned, the macros are part of the Windows API, so if you wish to use the API then you must deal with the macros yourself (e.g. with #undef). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1174724&group_id=2435 |