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?
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'.