473,795 Members | 3,333 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(voi d);
};

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 1628
cw*******@cogec o.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(voi d);
Abomination! (See
<http://groups.google.c om/group/comp.lang.c++/msg/895f1f98c4488dd a>.)
};

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*******@cogec o.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
2783
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 as member variables. So including a forward declaration doesnt help, does it? Faced with these, I had the following options: -Include the appropriate header in the header file that contains the class definition that has a member variable that is...
3
1423
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
1433
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 set_width(double width) { this->width = width; }
9
2962
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
4083
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 A { std::vector<B*> Bs; public:
6
2845
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 a user-defined class has overriden the virtual function in the base class? I have code like this which compiles with gcc 2.95.4: Attrib Implicits(PadRcv *obj){ Attrib accum = 0;
23
2374
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 replies to it.) I'm making a bignum package for use in a program I've got (this is something different from the pi program you may have heard about). The package is going to support manipulating long floating point numbers.
6
8165
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 situation where I am implementing base class functions by including a pointer to subclass member in base class. Reason being functionality is common for subclasses but the members are common within subclass only (static member of subclass) but...
10
1499
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 understand it well enough to answer my question... Here's the deal: without instantiating the class, the code in question calls both static and non-static member functions like this:
0
10436
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10163
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9040
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6780
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3722
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.