A simple problem
-
I have a problem. I have a project that include three form. I added an external header file (for example ****.h) in my project. When I add a picture box on one of the forms and select a picture for picture box, the compiler gives me an error "GetObjectA is not a member of System::ResourceManager::Resources" ( I think the error number is C2039 but I am not certain). I can't control this. Please help me at least time. turkish
-
I have a problem. I have a project that include three form. I added an external header file (for example ****.h) in my project. When I add a picture box on one of the forms and select a picture for picture box, the compiler gives me an error "GetObjectA is not a member of System::ResourceManager::Resources" ( I think the error number is C2039 but I am not certain). I can't control this. Please help me at least time. turkish
Managed C++,
#using
and Windows header macros don't mix too well. The file you've included has redefined GetObject to GetObjectA, so when you try to useResources::GetObject
, the preprocessor rewrites GetObject to GetObjectA, which doesn't exist. The preprocessor is basically dumb. The culprit appears to be WinGDI.h, which is included from Windows.h. It may seem odd to have two different entry points for GetObject, since it doesn't take any string parameters, but this controls whether calling GetObject on a font object handle returns a LOGFONTA or a LOGFONTW (and hence whether the lfFaceName string is ANSI or Unicode). About all you can do is find the call to Resources::GetObject, and either ensure that it occurs before WinGDI.h is included (not practical) or use#undef
to undefine GetObject.