By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,797 Members | 1,836 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,797 IT Pros & Developers. It's quick & easy.

Class member functions confused as Macros

P: n/a
Hi All,

I realize I may be posting to the wrong group, but I can't help but
think my problem is more related to C++ than Microsoft's particular C++
compiler.

I've been migrating a large project from CodeWarrior to Visual Studio
and I'm having some difficulty with the Microsoft compiler.

Here's the basic problem with simplified code:

class A
{
public:
bool IsMinimized(void);
};

bool A::IsMinimized(void)
{
return true;
}

int main()
{
A* theWindow = new A;
theWindow->IsMinimized(); // Problem here
delete theWindow;

return 0;
}

The problem is that the compiler has already encountered a macro
definition, as in:

#define IsMinimized(x) IsIconic(x)

And the compiler is warning me that my call to IsMinimized() "does not
have enough actual parameters for macro 'IsMinimized'."

Is there some way to resolve this issue short of renaming my class
member functions?

Thanks for any input.

Clint Weisbrod.

Nov 7 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
cw*******@cogeco.ca wrote:
I realize I may be posting to the wrong group, but I can't help but
think my problem is more related to C++ than Microsoft's particular C++
compiler.

I've been migrating a large project from CodeWarrior to Visual Studio
and I'm having some difficulty with the Microsoft compiler.

Here's the basic problem with simplified code:

class A
{
public:
bool IsMinimized(void);
Abomination! (See
<http://groups.google.com/group/comp.lang.c++/msg/895f1f98c4488dda>.)
};

bool A::IsMinimized(void)
{
return true;
}

int main()
{
A* theWindow = new A;
theWindow->IsMinimized(); // Problem here
delete theWindow;

return 0;
}

The problem is that the compiler has already encountered a macro
definition, as in:

#define IsMinimized(x) IsIconic(x)

And the compiler is warning me that my call to IsMinimized() "does not
have enough actual parameters for macro 'IsMinimized'."

Is there some way to resolve this issue short of renaming my class
member functions?
It's not related to Microsoft's compiler so much as their header files.
Don't include the offender (which you might be able to do if you skip
their all-inclusive stdafx.h-type construct) or #undef IsMinimized.

Cheers! --M

Nov 7 '06 #2

P: n/a
cweisbrod:
Is there some way to resolve this issue short of renaming my class
member functions?
Microsoft is a pack of retards -- you just have to get used to this sort of
tripe from them.

--

Frederick Gotham
Nov 7 '06 #3

P: n/a
cw*******@cogeco.ca wrote:
...
Is there some way to resolve this issue short of renaming my class
member functions?
...
Do an '#undef IsMinimized' right after including the offending header file.

--
Best regards,
Andrey Tarasevich
Nov 7 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.