0 Replies - 2728 Views - Last Post: 29 March 2012 - 01:45 AM

#1 Frankincense  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 14-March 12

Adding a Form icon - An unhandled exception.

Posted 29 March 2012 - 01:45 AM

Hi guys,

I am writing a CLI program with multiple forms. I am trying to put an icon in the top left corner by changing the value in the 'Icon' setting in the visual form editor. (I am using Visual c++ 2010).

Each time I add the icon and debug (the program builds correctly, only when the program is run, an error is found) i get this error message:

Anunhandled 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 "Password_Encryptor.Main.resources" was correctly embedded or linked into assembly "Password Encryptor" at compile time, or that all the satellite assemblies required are loadable and fully signed.


The program breaks on this line: this->Icon = (cli::safe_cast<System::Drawing::Icon^ >(resources->GetObject(L"$this.Icon")));

To get the icon I have changed the app.ico and re-added the file in the resource folder of the project.


I have tried a few resolutions, but none have solved my problem. Including settings the 'Item Type' of the .ico file to 'Compiled Managed Resource'.



Are there any obvious things wrong? Or is there anything I can check?


Note:
I am using .h files to initialize the functions, and a .cpp file to hold the actual function code.
I have changed my main namespace from 'testt4' to 'Password_Encryptor'.


Many thanks,
Jack

Is This A Good Question/Topic? 0
  • +

Page 1 of 1