#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