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. Managed C++/CLI
  4. strange compiler error

strange compiler error

Scheduled Pinned Locked Moved Managed C++/CLI
c++winformsgraphicsgame-devhelp
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.
  • S Offline
    S Offline
    Slaru
    wrote on last edited by
    #1

    Hi, I am learning C++ and Windows Forms and get a strange compiler error. I am using the directX header dshow.h for my project and when I do I get this error: error C2039: 'GetObjectA' : is not a member of 'System::Resources::ResourceManager' stdafx.cpp(0) : see declaration of 'System::Resources::ResourceManager' and it points to this code: this->ButtonImages->ImageStream = (__try_cast(resources->GetObject(S"ButtonImages.ImageStream"))); and this was all generated by the designer. I also get something similar when I try to use the MessageBox class. If I don't imclude dshow.h than these errors go away. Any reasons and fixes are appreciated. Thanks.

    N 1 Reply Last reply
    0
    • S Slaru

      Hi, I am learning C++ and Windows Forms and get a strange compiler error. I am using the directX header dshow.h for my project and when I do I get this error: error C2039: 'GetObjectA' : is not a member of 'System::Resources::ResourceManager' stdafx.cpp(0) : see declaration of 'System::Resources::ResourceManager' and it points to this code: this->ButtonImages->ImageStream = (__try_cast(resources->GetObject(S"ButtonImages.ImageStream"))); and this was all generated by the designer. I also get something similar when I try to use the MessageBox class. If I don't imclude dshow.h than these errors go away. Any reasons and fixes are appreciated. Thanks.

      N Offline
      N Offline
      Nemanja Trifunovic
      wrote on last edited by
      #2

      That's because preprocessors are stupid. When a preprocessor finds GetObject, it replaces it with GetObjectA or GetObjectW, depending whether you compile a Unicode version or not. Just put something like #undef GetObject after #include <windows.h> and everything should work fine.

      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