Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. A simple problem

A simple problem

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    deniz79s
    wrote on last edited by
    #1

    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

    M 1 Reply Last reply
    0
    • D deniz79s

      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

      M Offline
      M Offline
      Mike Dimmick
      wrote on last edited by
      #2

      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 use Resources::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.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups