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. problem with Picturebox / windows.h

problem with Picturebox / windows.h

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
5 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
    doneirik
    wrote on last edited by
    #1

    Hi I made an application that operates on the serialport. Using "CreateFile" I must include windows.h Now I have re-written my app and wanted to include an image in the GUI, so I used "Picturebox". However, with the picturebox and the picture, it looks like I cannot include the headerfile windows.h. When I include it , I get the message: error C2039: "GetObjectA" is not a member of "System::Resources::ResourceManager" This errormessage is pointing to the line in my code dealing with the image. Does anybody know what I have done wrong? regards donE

    F 2 Replies Last reply
    0
    • D doneirik

      Hi I made an application that operates on the serialport. Using "CreateFile" I must include windows.h Now I have re-written my app and wanted to include an image in the GUI, so I used "Picturebox". However, with the picturebox and the picture, it looks like I cannot include the headerfile windows.h. When I include it , I get the message: error C2039: "GetObjectA" is not a member of "System::Resources::ResourceManager" This errormessage is pointing to the line in my code dealing with the image. Does anybody know what I have done wrong? regards donE

      F Offline
      F Offline
      foobar
      wrote on last edited by
      #2

      Read this...http://www.kbalertz.com/kb_888267.aspx said ifdef then undef on the getobject.... it is an issue with including windows.h If it works, let me know. I get a runtime error

      1 Reply Last reply
      0
      • D doneirik

        Hi I made an application that operates on the serialport. Using "CreateFile" I must include windows.h Now I have re-written my app and wanted to include an image in the GUI, so I used "Picturebox". However, with the picturebox and the picture, it looks like I cannot include the headerfile windows.h. When I include it , I get the message: error C2039: "GetObjectA" is not a member of "System::Resources::ResourceManager" This errormessage is pointing to the line in my code dealing with the image. Does anybody know what I have done wrong? regards donE

        F Offline
        F Offline
        foobar
        wrote on last edited by
        #3

        ok - here is a workaround.... ////REMOVE the code the IDE gave you!!!! //this->pictureBox1->Image = (__try_cast(resources->GetObject(S"pictureBox1.Image"))); ///ADD This line this->pictureBox1->Image = Image::FromFile(S"sm_titan.bmp"); This can get all crazy with a file name so here is an example with a image directory and numbered images: pictureBox1->Image = Image::FromFile( string::concat( directory::GetCurrentDirectory(), s"\\image\\image", imageNum.ToString(),s".bmp")); Hope it helps!

        D 1 Reply Last reply
        0
        • F foobar

          ok - here is a workaround.... ////REMOVE the code the IDE gave you!!!! //this->pictureBox1->Image = (__try_cast(resources->GetObject(S"pictureBox1.Image"))); ///ADD This line this->pictureBox1->Image = Image::FromFile(S"sm_titan.bmp"); This can get all crazy with a file name so here is an example with a image directory and numbered images: pictureBox1->Image = Image::FromFile( string::concat( directory::GetCurrentDirectory(), s"\\image\\image", imageNum.ToString(),s".bmp")); Hope it helps!

          D Offline
          D Offline
          doneirik
          wrote on last edited by
          #4

          thanks Didn´t have time to try your suggestion yet, however, tried the examples on the msdn site: http://support.microsoft.com/default.aspx?scid=kb;en-us;888267[^] This works, but after adding this code, I cannot get back to design modus... donE

          F 1 Reply Last reply
          0
          • D doneirik

            thanks Didn´t have time to try your suggestion yet, however, tried the examples on the msdn site: http://support.microsoft.com/default.aspx?scid=kb;en-us;888267[^] This works, but after adding this code, I cannot get back to design modus... donE

            F Offline
            F Offline
            foobar
            wrote on last edited by
            #5

            Yea, I got the same.... Use the file name if you can. That works no problem. picBox->Image = Image::FromFile(S"filePic.bmp")

            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