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