473,398 Members | 2,088 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,398 software developers and data experts.

Compile Erros when Adding an icon in C++.NET using <windows.h>

hi guys,
i really need your help!! i want to add a toolbar with some push
buttons in which i put some icons. it works without including
<windows.h>. However, i really need this library so i dont know what
to do. HELP ME. i get this error:

d:\Generic Control\SMACT\Form1.h(473): error C2039: 'GetObjectA'*:
n'est pas membre de 'System::Resources::ResourceManager'
and here is the code:

this->imageList1->ImageStream =
(__try_cast<System::Windows::Forms::ImageListStrea mer *
(resources->GetObject(S"imageList1.ImageStream")));

Help me!!
Nov 17 '05 #1
1 1321
i really need your help!! i want to add a toolbar with some push
buttons in which i put some icons. it works without including
<windows.h>. However, i really need this library so i dont know what
to do. HELP ME. i get this error:

d:\Generic Control\SMACT\Form1.h(473): error C2039: 'GetObjectA' :
n'est pas membre de 'System::Resources::ResourceManager'
and here is the code:

this->imageList1->ImageStream =
(__try_cast<System::Windows::Forms::ImageListStrea mer *
(resources->GetObject(S"imageList1.ImageStream")));


Help me!!


this problem is caused by several #defines in windows.h and other header
files like:

#ifdef _UNICODE
#define GetObject GetObjectW
#else
#define GetObject GetObjectA
#endif

so your code gets preprocessed to
resources->GetObjectA instead of
resources->GetObject

solution is to undef the offending define like
#undef GetObject or
#define GetObject GetObject

hth

--
Ben
http://bschwehn.de
Nov 17 '05 #2

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

Similar topics

1
by: Greg Busby | last post by:
I have a client who wants to use Windows Integrated Security for authentication and authorization to use this application. They also want this application to run as soon as Windows comes up. So, I...
4
by: Dave | last post by:
Hi, Is there anyway to mimic forms authentication's loginUrl and RedirectFromLoginPage functionality using Windows authentication? We are developing intranet sites using basic authentication...
1
by: Marlon | last post by:
I got the error message below when I try to open a connection with code: Dim connection As New OdbcConnection("Driver={Microsoft Text Driver (*.txt; *.csv)};DBQ=C:\Inetpub\aesd")...
0
by: Fabrício de Novaes Kucinskis | last post by:
Hi all, My ASP.net application uses Windows Authentication. When using Forms Authentication, if the session expires, the common thing to do is to redirect the user to the login page again. ...
7
by: etam | last post by:
How, by code can i set the program to be started when windows is started? Do sth with some files like in linux or what? -- Pozdrawiam, Etam.
4
by: Markus Stoeger | last post by:
Hi, I have a problem with Application.Run() when Windows is shutting down. Please have a look at the copy&paste example program below. The application has no forms. It has only got a notify...
3
by: ajay2552 | last post by:
Hi, I have a query. All html tags start with < and end with >. Suppose i want to display either '<' or '>' or say some text like '<Company>' in html how do i do it? One method is to use &lt,...
3
by: Patrick Dugan | last post by:
I am using VS2005 (vb) and I have a program that starts when Windows boots up. Occasionally the icon that should appear in the system tray does not show up. The program is still running in memory...
1
by: Sebouh | last post by:
Hi guys. I''m curious about what happens when windows shuts down. I have a program running that saves data into a file when the form's closing method is invoked. So when Windows shuts down, does...
2
by: fairbanj | last post by:
I am using Windows Authentication and I am trying to determine how to swap users (like when a supervisor needs to temporarily boost the priviledges of a session by logging into his own account and...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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
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,...

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.