473,320 Members | 1,876 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,320 software developers and data experts.

error with system::resources

Hello everyone

In a windows forms that i have compiled and includes code like this :

this->Icon = (__try_cast<System::Drawing::Icon * >(resources->GetObject(S"$this.Icon")));

i get an error like this:

error C2039: 'GetObjectA' : is not a member of 'System::Resources::ResourceManager'

the only thing i added to the code is to include to the main form header those includes :

#include <windows.h>

#include <wininet.h>
#include <shlobj.h>

#include <atlbase.h>

#include "AboutBox.h"
#include "OptionsBox.h"

Any suggestions ?
Thanks
Nov 17 '05 #1
2 1362
Emmanouel wrote:
Hello everyone

In a windows forms that i have compiled and includes code like this :

this->Icon = (__try_cast<System::Drawing::Icon * >(resources->GetObject(S"$this.Icon")));

i get an error like this:

error C2039: 'GetObjectA' : is not a member of 'System::Resources::ResourceManager'

the only thing i added to the code is to include to the main form header those includes :

#include <windows.h>

#include <wininet.h>
#include <shlobj.h>

#include <atlbase.h>

#include "AboutBox.h"
#include "OptionsBox.h"

Any suggestions ?
Thanks

After the #includes, put this:
#ifdef GetObject
#undef GetObject
#endif
--
Jacobo RodrÃ*guez Villar

TyphoonLabs Lead Programmer

http://www.typhoonlabs.com
Nov 17 '05 #2
Thank you very much jacobo....

You are a life saver :)

Thanks

"Jacobo Rodriguez Villar" wrote:
Emmanouel wrote:
Hello everyone

In a windows forms that i have compiled and includes code like this :

this->Icon = (__try_cast<System::Drawing::Icon * >(resources->GetObject(S"$this.Icon")));

i get an error like this:

error C2039: 'GetObjectA' : is not a member of 'System::Resources::ResourceManager'

the only thing i added to the code is to include to the main form header those includes :

#include <windows.h>

#include <wininet.h>
#include <shlobj.h>

#include <atlbase.h>

#include "AboutBox.h"
#include "OptionsBox.h"

Any suggestions ?
Thanks

After the #includes, put this:
#ifdef GetObject
#undef GetObject
#endif
--
Jacobo RodrÃ*guez Villar

TyphoonLabs Lead Programmer

http://www.typhoonlabs.com

Nov 17 '05 #3

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

Similar topics

1
by: DelboyJay | last post by:
I have found a strange resource problem, but luckily I have also found the solution which was not obvious from the runtime exception. I really think that the compiler should pick up this problem...
1
by: DelboyJay | last post by:
I have found a strange resource problem, but luckily I have also found the solution which was not obvious from the runtime exception. I really think that the compiler should pick up this problem...
0
by: Carlo Marchesoni | last post by:
My ASP.NET app works with resources for loading text to the different controls (multilingual app) and everything works fine. but from time to time I have the following error. Then I have to wait...
0
by: Darrel | last post by:
Anyone know what would cause this error. It's not a typical error, it's text that is shown instead of what my usercontrol is supposed to render. ---------------------------- text/microsoft-resx...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.