delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/03/24/10:23:19

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <000b01be7609$9fc25950$0f0a0181@devel014>
From: "Nirmal Prasad" <nprasad AT truept DOT com>
To: <cygwin AT sourceware DOT cygnus DOT com>
Subject: Win32 Defines & C++
Date: Wed, 24 Mar 1999 10:18:49 -0500
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3

------=_NextPart_000_0008_01BE75DF.B575DDF0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

hi there,

This is not a cygwin related query,bug or feature request but if someone =
can help it will be great b'cos i am getting this problem in some code =
that i have while compiling under cygwin.

The problem i am facing is that i have some c++ class that has a member =
function which is the same as a win32 define (e.g. GetNextWindow). The =
problem is that the pre-processor substitues this and the compiler =
complains that there is something wrong. One of the solutions i thought =
of getting around this is to make the #define'd macro to an inline =
function and the code would then compile but this would be tedious if =
its a lot of macros . I was wondering if there is any other elegant =
solution such that i dont have to change any code.????

Thanks in advance

Regards

Nirmal Prasad R.

e.g.=20
#define GetNextWindow(h,c)    GetWindow(h,c)        /* somewhere in some =
win32 header */

//.. This is in my file
class test
{
    public:
            ... some members
           void GetNextWindow(uint c);                //<- get an error =
here as "GetNextWindow" called with 1 argument only
};

------=_NextPart_000_0008_01BE75DF.B575DDF0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.72.3110.7"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#000000 size=3D2>hi there,</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>This is not a cygwin related =
query,bug or=20
feature request but if someone can help it will be great b'cos i am =
getting this=20
problem in some code that i have while compiling under =
cygwin.</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>The problem i am facing is that i =
have some c++=20
class that has a member function which is the same as a win32 define =
(e.g.=20
GetNextWindow). The problem is that the pre-processor substitues this =
and the=20
compiler complains that there is something wrong. One of the solutions i =
thought=20
of getting around this is to make the #define'd macro to an inline =
function and=20
the code would then compile but this would be tedious if its a lot of =
macros . I=20
was wondering if there is any other elegant solution such that i dont =
have to=20
change any code.????</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>Thanks in advance</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>Regards</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>Nirmal Prasad R.</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>e.g. </FONT></DIV>
<DIV><FONT size=3D2>#define GetNextWindow(h,c)&nbsp;&nbsp;&nbsp;=20
GetWindow(h,c)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* somewhere in =
some=20
win32 header */</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>//.. This is in my file</FONT></DIV>
<DIV><FONT size=3D2>class test</FONT></DIV>
<DIV><FONT size=3D2>{</FONT></DIV>
<DIV><FONT size=3D2></FONT><FONT color=3D#000000 =
size=3D2>&nbsp;&nbsp;&nbsp; <FONT=20
color=3D#000000>public:</FONT></FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2><FONT=20
color=3D#000000></FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;=20
... some members</FONT></DIV>
<DIV><FONT color=3D#000000=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
void=20
GetNextWindow(uint=20
c);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;=20
//&lt;- get an error here as &quot;GetNextWindow&quot; called with 1 =
argument=20
only</FONT></DIV>
<DIV><FONT size=3D2>};</FONT></DIV></BODY></HTML>


------=_NextPart_000_0008_01BE75DF.B575DDF0
Content-Type: text/plain; charset=us-ascii

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
------=_NextPart_000_0008_01BE75DF.B575DDF0--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019