|
From: ma on 12 Mar 2006 13:04 Hello, I am new in .NET and I am writing my first program in c++/CLI on MSVC 2005. I add a PictureBox to my form and then using its properties I change its image property to one image from my hard disk. it generate the following code for me: this->image1->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"image1.Image"))); but when I am running my program, it generate an exception with the error that it couldn't find the specified objects in my resources. I checked the resource and there is no resource with this name there. What is wrong with this? Best regards
From: Bruno van Dooren on 12 Mar 2006 14:39 -- Kind regards, Bruno. bruno_nos_pam_van_dooren(a)hotmail.com Remove only "_nos_pam" "ma" <ma(a)nowhere.com> wrote in message news:%234uW59fRGHA.4696(a)tk2msftngp13.phx.gbl... > Hello, > > I am new in .NET and I am writing my first program in c++/CLI on MSVC > 2005. > > > > I add a PictureBox to my form and then using its properties I change its > image property to one image from my hard disk. it generate the following > code for me: > > this->image1->Image = (cli::safe_cast<System::Drawing::Image^ > >(resources->GetObject(L"image1.Image"))); > > but when I am running my program, it generate an exception with the error > that it couldn't find the specified objects in my resources. I checked > the > resource and there is no resource with this name there. > > What is wrong with this? > > > > Best regards > > >
From: Bruno van Dooren on 12 Mar 2006 14:47 "ma" <ma(a)nowhere.com> wrote in message news:%234uW59fRGHA.4696(a)tk2msftngp13.phx.gbl... > Hello, > > I am new in .NET and I am writing my first program in c++/CLI on MSVC > 2005. > > > > I add a PictureBox to my form and then using its properties I change its > image property to one image from my hard disk. it generate the following > code for me: > > this->image1->Image = (cli::safe_cast<System::Drawing::Image^ > >(resources->GetObject(L"image1.Image"))); > > but when I am running my program, it generate an exception with the error > that it couldn't find the specified objects in my resources. I checked > the > resource and there is no resource with this name there. > > What is wrong with this? I just did the same thing: added a picture box and assigned it an image. if you double click the resource, you can select the type of resources that you want displayed. if you select 'images' you should see the different images that are embedded in the resource file. If there is nothing there, you will get that exception. I suggest you try to find out why it is not there. Possibly a permission problem or something else? btw: there is also a dedicated C++ .NET newsgroup: public.dotnet.languages.vc -- Kind regards, Bruno. bruno_nos_pam_van_dooren(a)hotmail.com Remove only "_nos_pam"
|
Pages: 1 Prev: dynamic creation of push button Next: PostMessage question |