Resource Files, Satellite Assembly - newbie

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This has been bothering me for the last couple of hours.

Here is what I would like to do.
I want to create a sample when a button is clicked, depending on Culture I
would like to display the flag.

What I did was create a resx file using ResxResourceWriter and AddResource
Method. I included few countries' flags in the resx file. I used resgen to
create the .resource file.

I am using the following lines of code:
rm = New ResourceManager("MyImages", Me.GetType().Assembly)

and

PictureBox1.Image = CType(rm.GetObject("MyImage", ci), System.Drawing.Image)

Using the reseditor I could see the bitmap files in the file. When I run the
sample I keep getting the 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) in the given assembly. Make sure
"MyImages.resources" was correctly embedded or linked into assembly
"ResourceFileSample".

I tried including the .resources file in the peoject, compiled but still got
the same error.

I tried creating the resource dll and included in the reference but no change.

I have the subdirectories created for the test Cultures an d created the
corresponding resource files.

Is my understanding wrong? Please help or any links that I can look into
will be a great help
 
I think u have to include the name of the assembly

as such in your call to create the ResourceManager

rm = New ResourceManager("ResourceFileSample.MyImages",
Me.GetType().Assembly)
^^ the change..

Morgan
 
Hi,
I apologize for the delay in response.

Thanks it worked well for nuetral culturs but how about others. The way I
did was create a folder for ex - de-DE for German. I create the resource file
with the names MyImages.de-DE.resx file in this folder. I compile a resource
file with resgen and set the currentthreads currentculture to "de-DE". German
flag could not be retrieved, it still retrieves the same nuetral flag.

Thanks again

vb
 
Back
Top