Class member functions confused as Macros

C

cweisbrod

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.
 
M

mlimber

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
};

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
 
F

Frederick gotham

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.
 
A

Andrey Tarasevich

...
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top