473,382 Members | 1,441 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Class member functions confused as Macros

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
3 1609
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Mon | last post by:
I am in the process of reorganizing my code and came across and I came across a problem, as described in the subject line of this posting. I have many classes that have instances of other classes...
3
by: N4M | last post by:
Dear, I have codes as follows: template<class T> class A { public: // embedded class class E; public: // types typedef E TE; public:// member functions TE somefunc();
18
by: Jason Heyes | last post by:
Is this class evidence of poor design? class Rectangle { double width, height; public: double get_width() const { return width; } double get_height() const { return height; } void...
9
by: baumann | last post by:
hi all, to implement a singleton class, one has define a static function in the singleton class, class A{ public: static A* getInstance() { static A a; return &a;
21
by: Jon Slaughter | last post by:
I have a class that is basicaly duplicated throughout several files with only members names changing according to the class name yet with virtually the exact same coding going on. e.g. class...
6
by: noel.hunt | last post by:
I have a base class, PadRcv, with virtual functions. User code will derive from this class and possibly supply it's own functions to override the base class virtual functions. How can I test that...
23
by: mike3 | last post by:
Hi. (posted to both newsgroups since I was not sure of which would be appropriate for this question or how specific to the given language it is. If one of them is inappropriate, just don't send...
6
by: Bhawna | last post by:
I am into c++ code maintenance for last 3-4 years but recently I am put into design phase of a new project. Being a small comapany I dont have enough guidance from seniors. Currently I am into a...
10
by: ejstans | last post by:
Hello, I encountered something unfamiliar to me today and I would like some clarifications. Unfortunately I don't have access to a standard but even if I did, I'm not even sure if I could...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.