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?