Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / IDE / March 2005

Tip: Looking for answers? Try searching our database.

VC++ .Net Compile Problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
z80hastings - 16 Mar 2005 00:06 GMT
Using VC++ .Net Version 7. Not sure if any1 can help, or if I'm just being
incredibly dumb; project was working fine, now for some reason won't
compile, the error im getting is:

c:\Programming\C++ .Net\TiffExplorer\FormCompile.h(118) : error C2039:
'GetObjectA' : is not a member of 'System::Resources::ResourceManager'
stdafx.cpp(0) : see declaration of 'System::Resources::ResourceManager'

But the line causing the error isnt trying to Call 'GetObjectA'

//
// imgOptions
//
this->imgOptions->ImageSize = System::Drawing::Size(16, 16);
this->imgOptions->ImageStream =
(__try_cast<System::Windows::Forms::ImageListStreamer *
>(resources->GetObject(S"imgOptions.ImageStream")));
this->imgOptions->TransparentColor = System::Drawing::Color::Transparent;

I have the same set-up (i.e. treeView item and linked imageList on another
form; code looks exactly the same yet produces no errors).
Anyone got any idea?
Steve McLellan - 16 Mar 2005 18:34 GMT
Hi,

Try putting the following near the top of the file:
#undef GetObject

Steve

> Using VC++ .Net Version 7. Not sure if any1 can help, or if I'm just being
> incredibly dumb; project was working fine, now for some reason won't
[quoted text clipped - 18 lines]
> form; code looks exactly the same yet produces no errors).
> Anyone got any idea?
z80hastings - 16 Mar 2005 20:06 GMT
Sorted it! Thanks. Just out of interest, do you know what caused it?

> Hi,
>
[quoted text clipped - 25 lines]
>> another form; code looks exactly the same yet produces no errors).
>> Anyone got any idea?
Steve McLellan - 17 Mar 2005 15:09 GMT
Hi,

Yeah - just as with MessageBox, there's a definition for GetObject somewhere
in the Windows SDK, so where you've got #include <windows.h> somewhere in
the file being compiled, the preprocessor does a literal translation from
'System::Resources::ResourceManager::GetObject' to
'System::Resources::ResourceManager::GetObjectA'. These kinds of name
clashes are quite common - it's best to try to work out whether you need
<windows.h> included everywhere.

Steve

> Sorted it! Thanks. Just out of interest, do you know what caused it?
>
[quoted text clipped - 28 lines]
>>> another form; code looks exactly the same yet produces no errors).
>>> Anyone got any idea?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.