D
DaveGriffin
Guest
I have an application that was developed in non-CLR C++ (unmanaged) in VS2003 (or earlier) but is working in VS2005 after some converting. Note that I didn’t do that converting. My employer decided to update the code to CLR VS2010 for easier maintenance. I am a C# programmer and haven’t done C++ for a while and not within VS so I’m not the most experienced in this task.
I’ve set it to CLR and corrected the errors and most of the warnings, but I’m having a problem with some image resources in the Form1.resX file (took me a while to even figure out that the resources were IN that .resx file).
I can see them in there and the Form [Design] editor can see the resource and paints the image as a background for its tab:
this->tabPage1->BackgroundImage = (safe_cast(resources->GetObject("tabPage1.BackgroundImage")));
The resX file is version 1.3 of the schema or so it says rather than the 2.0 that a newly created windows forms application has but seems OK otherwise.
So the call seems correctly formed and it’s good enough for the design editor to show the image in the background of the tab inside Visual Studio. But when you run it you get an error:
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 "PRG.Form1.resources" was correctly embedded or linked into assembly "PRG" at compile time, or that all the satellite assemblies required are loadable and fully signed.
As you can see, the culture is neutral so the fact that there is no culture in the call seems right. I tried deleting the culture tag from the resource entirely but that had no effect. I don’t know quite what the program wants me to do in order to get this image to come up in the running application.
Just wanted to add the line that connects the resource file to the form because i'm thinking that could be a problem but I don't know quite how.
System::Resources::ResourceManager ^ resources = gcnew System::Resources::ResourceManager(C5MLV::Form1::typeid);
As an experiment, I tried manually adding the background image directly to the form. It erased the existing resources in the .resX file and replaced them with a file at Version 2.0 with just that new image. Unfortunately it didn't work, it got the same error. Since this is a program that has been upgraded continuously, I suspect there are some issues associated with repeated conversion and this is why adding the image doesn't work -- there is probably some code in there from previous VS versions that is problematic to the program when it runs, but I'm not sure quite how to track that down.
Any suggestions?
Dave Griffin
Continue reading...
I’ve set it to CLR and corrected the errors and most of the warnings, but I’m having a problem with some image resources in the Form1.resX file (took me a while to even figure out that the resources were IN that .resx file).
I can see them in there and the Form [Design] editor can see the resource and paints the image as a background for its tab:
this->tabPage1->BackgroundImage = (safe_cast(resources->GetObject("tabPage1.BackgroundImage")));
The resX file is version 1.3 of the schema or so it says rather than the 2.0 that a newly created windows forms application has but seems OK otherwise.
So the call seems correctly formed and it’s good enough for the design editor to show the image in the background of the tab inside Visual Studio. But when you run it you get an error:
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 "PRG.Form1.resources" was correctly embedded or linked into assembly "PRG" at compile time, or that all the satellite assemblies required are loadable and fully signed.
As you can see, the culture is neutral so the fact that there is no culture in the call seems right. I tried deleting the culture tag from the resource entirely but that had no effect. I don’t know quite what the program wants me to do in order to get this image to come up in the running application.
Just wanted to add the line that connects the resource file to the form because i'm thinking that could be a problem but I don't know quite how.
System::Resources::ResourceManager ^ resources = gcnew System::Resources::ResourceManager(C5MLV::Form1::typeid);
As an experiment, I tried manually adding the background image directly to the form. It erased the existing resources in the .resX file and replaced them with a file at Version 2.0 with just that new image. Unfortunately it didn't work, it got the same error. Since this is a program that has been upgraded continuously, I suspect there are some issues associated with repeated conversion and this is why adding the image doesn't work -- there is probably some code in there from previous VS versions that is problematic to the program when it runs, but I'm not sure quite how to track that down.
Any suggestions?
Dave Griffin
Continue reading...