473,500 Members | 1,929 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Compiler error after setting icon property

TGF
Hello,

When I attempt to set the icon property on a Windows form (.NET), when I
go to compile, I get the following error....

e:\Projects\MyApp\AboutForm.h(108): error C2039: 'GetObjectA' : is not a
member of 'System::Resources::ResourceManager'

....Does anyone know why this happens, and the way to correct it....I looked
up the function member "GetObject", and it is a valid member function. Note
that this error occurs in the InitializeComponent() function where the VS
code generator says not to edit it. So what gives!

--
TGF
Nov 16 '05 #1
3 2362
Add

#undef GetObject

somewhere after your includes and before the line that contains GetObject.

Ronald Laeremans
Visual C++ team

"TGF" <tf***@engr.uconn.edu[remove brackets]> wrote in message
news:Os**************@TK2MSFTNGP11.phx.gbl...
Hello,

When I attempt to set the icon property on a Windows form (.NET), when I go to compile, I get the following error....

e:\Projects\MyApp\AboutForm.h(108): error C2039: 'GetObjectA' : is not a
member of 'System::Resources::ResourceManager'

...Does anyone know why this happens, and the way to correct it....I looked up the function member "GetObject", and it is a valid member function. Note that this error occurs in the InitializeComponent() function where the VS
code generator says not to edit it. So what gives!

--
TGF

Nov 16 '05 #2
TGF
Ron,

Thanks for the help! I would really like to eliminate the error if at
all possible, rather than working around it.

-TGF

"Ronald Laeremans [MSFT]" <ro*****@online.microsoft.com> wrote in message
news:O2**************@tk2msftngp13.phx.gbl...
Add

#undef GetObject

somewhere after your includes and before the line that contains GetObject.

Ronald Laeremans
Visual C++ team

"TGF" <tf***@engr.uconn.edu[remove brackets]> wrote in message
news:Os**************@TK2MSFTNGP11.phx.gbl...
Hello,

When I attempt to set the icon property on a Windows form (.NET), when
I
go to compile, I get the following error....

e:\Projects\MyApp\AboutForm.h(108): error C2039: 'GetObjectA' : is not a
member of 'System::Resources::ResourceManager'

...Does anyone know why this happens, and the way to correct it....I

looked
up the function member "GetObject", and it is a valid member function.

Note
that this error occurs in the InitializeComponent() function where the

VS code generator says not to edit it. So what gives!

--
TGF


Nov 16 '05 #3
#undef-ing GetObject does eliminate the error - it's not a workaround.

The problem is that <windows.h> #defines several hundred words as macros -
many of those same words exist as member function names in the .NET
framework classes. The combination of those two facts means that when you
have a translation unit that #includes <windows.h> and uses .NET framework
classes, you're likely to have name clashes between the macros and the .NET
member functions. Since macros are unscoped, the only real solutions are:
1. Don't mix <windows.h> and .NET in the same translation unit or 2. #undef
the names that clash.

-cd

TGF wrote:
Ron,

Thanks for the help! I would really like to eliminate the error
if at all possible, rather than working around it.

-TGF

"Ronald Laeremans [MSFT]" <ro*****@online.microsoft.com> wrote in
message news:O2**************@tk2msftngp13.phx.gbl...
Add

#undef GetObject

somewhere after your includes and before the line that contains
GetObject.

Ronald Laeremans
Visual C++ team

"TGF" <tf***@engr.uconn.edu[remove brackets]> wrote in message
news:Os**************@TK2MSFTNGP11.phx.gbl...
Hello,

When I attempt to set the icon property on a Windows form
(.NET), when I go to compile, I get the following error....

e:\Projects\MyApp\AboutForm.h(108): error C2039: 'GetObjectA' : is
not a member of 'System::Resources::ResourceManager'

...Does anyone know why this happens, and the way to correct
it....I looked up the function member "GetObject", and it is a
valid member function. Note that this error occurs in the
InitializeComponent() function where the VS code generator says not
to edit it. So what gives!

--
TGF

Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
992
by: TGF | last post by:
Hello, When I attempt to set the icon property on a Windows form (.NET), when I go to compile, I get the following error.... e:\Projects\MyApp\AboutForm.h(108): error C2039: 'GetObjectA' : is...
3
1403
by: TGF | last post by:
Hello, When I attempt to set the icon property on a Windows form (.NET), when I go to compile, I get the following error.... e:\Projects\MyApp\AboutForm.h(108): error C2039: 'GetObjectA' : is...
10
2537
by: Zeljko | last post by:
Hi, I have a form with a tray icon. However, when I minimize the form, it stays visible - not in the task bar (I have showintaskbar property set to false), but in a form of a rectangle sitting...
20
1574
by: Scott Simons | last post by:
Why doesn't the compiler throw an error on a block of code like this: public string Email { get { return Email; } }
3
5065
by: VJ | last post by:
I am trying to set my Form's Icon property at run time based on certain parameters. I have a imglist in the form for other purposes I would like to use the same image list to keep the Forms icon...
5
3149
by: IcingDeath via DotNetMonster.com | last post by:
I am building this SQL Server database app in which i can store files. In order to display files I want to have the app show the associated icon for the extension of the file that is in the...
3
2836
by: Nina | last post by:
Hi there, I assigned icon for a window's form using form's Icon property at design time. Now I want to change the icon. I tried to replace the old icon with the new icon using form's Icon...
4
7992
by: Gary | last post by:
Hi, I get this error " " when my web page run, what does it mean? Hope someone can help!!! Gary
4
6527
by: randy1200 | last post by:
I have a Windows application that previously had the company logo "MyCompany.ico" added to the upper left-most corner. The company has since issued a new version of "MyCompany.ico" that looks...
0
7232
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6906
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...
0
7397
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...
0
5490
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,...
0
4611
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...
0
3110
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1430
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 ...
1
672
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
316
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...

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.