Jump to content
Che

[Visual Studio C++ .Net] Ajutor: Cum pot scapa de aceasta eroare ?

Recommended Posts

Posted

Eroarea asta o primesc cand vreau sa execut acel executabil, fie normal, fie in debugger:

An unhandled exception of type 'System.Resources.MissingManifestResourceException' occurred in mscorlib.dll

Additional information: Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "WindowsFormsApplication.MyForm.resources" was correctly embedded or linked into assembly "ImageResourceTest" at compile time, or that all the satellite assemblies required are loadable and fully signed.

1znsav6.jpg

Practic e un simplu WindowsForm caruia i-am adaugat un PictureBox si i-am bagat o imagine in acel PictureBox.

Cand rulez aplicatia se opreste la aceasta linie de cod:

//

// pictureBox1

//

//ASTA E LINIA DE COD UNDE SE OPRESTE CAND DAI RUN:

this->pictureBox1->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"pictureBox1.Image")));

////////////////////////////////////////////////////////////////

this->pictureBox1->Location = System::Drawing::Point(28, 45);

this->pictureBox1->Name = L"pictureBox1";

this->pictureBox1->Size = System::Drawing::Size(219, 190);

this->pictureBox1->SizeMode = System::Windows::Forms::PictureBoxSizeMode::StretchImage;

this->pictureBox1->TabIndex = 0;

this->pictureBox1->TabStop = false;

Si daca ii pun eu un icon aplicatiei, tot la fel face.

Am bagat imaginea si in resurse si tot degeaba.

Folosesc Visual Studio 2013.

Va pun acest proiect simplu ca test ca sa vedeti si voi ce are, poate va pricepeti mai bine si reusiti sa-i dati de capat:

ImageResourceTest

Multumesc mult pentru ajutor !

Posted

@Ganav

Rezolvare

Nu inteleg de ce trebuie sa ai numele formei si namespace diferit dar modifici/adaugi acolo "WindowsFormsApplication.MyForm.resources" si ai rezolvat problema.

Am vazut ca in Visual Studio 2013 nu exista un template ca sa poti crea un proiect GUI gen WindowsFormsApplication, asa cum era inainte in VS 2008 spre exemplu.

Asa ca am cautat pe Google sa vad cum se rezolva problema si am dat peste acest video:

Tutorials++: How to create a Windows Forms Application Project in Visual C++ Express 2012

Asa ca m-am gandit ca nu ar fi rau sa-mi fac eu propriul meu template ca sa-l am acolo de cate ori am nevoie sa fac un WindowsForm.

Asa ca am cautat cum se face un template si Google ne invata:

Create Your Own Project Template in Visual Studio

Am facut exact asa ca acolo.

De aici se trag toate problemele. Am cautat ieri toata ziua sa vad cum rezolv chestia asta care va intreb acum si tot nu am reusit.

Am dat si eu peste aceasta rezolvare de aici:

https://support.microsoft.com/en-us/kb/839298

Numai ca e o problema:

5. In the Form1.resX Property Pages dialog box, expand Configuration Properties, and then click General under Managed Resources.

6. Change the Resource File Name property from $(IntDir)/Q839298.Form1.resources to $(IntDir)/Q839298.MyForm.resources, and then click OK.

Eu nu am "Resource File Name" property. Unde sa modific numele daca nu am ce nume sa modific ?

2rrp0s0.jpg

Apropo, cum sa creez template-ul ca sa nu mai aceasta problema cu denumirea sau care o fi ea de-mi cauzeaza aceasta eroare ?

Multumesc anticipat !

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...