First off I have RFM and RFM and I have tried to follow a few sites but I cannot grasp the concept of the Resource Manager.
Can someone please explain to me how to generate a resource manager similar to that of the VS IDE.
For example if I compile with VBC from the commandline I can see all my resource files.
vbc /t:exe myfile.vb /res:res1 /res:res2
Dim a as Assembly = Assembly.GetExecutingAssembly()
For Each i as string in a.GetManifestResourceNames()
Console.writeline(i)
Next i
res1
res2
If I compile with the VS IDE I only see:
myprogram.Resources.resource
How do I create a resource manager manually from the command line so that I can use the resource manager like I would with the VS IDE?
Dim CurrentResourceManager As New ResourceManager(_
"myprogram.Resources", CurrentAssembly)
Dim CurrentResourceSet As ResourceSet = CurrentResourceManager.GetResourceSet( _
CultureInfo.CurrentCulture, True, True)
When I do try to use resgen it complains about my file extention
C:...>resgen image.bmp myfile.Resource.resource source
ResGen : error RG0000: The file named "image.bmp" does not have a known extension. Managed resource files must end in .ResX, .txt, or .resources.
In the Manual it states to use RESXGEN for images, but I do not believe that is available in VS2008. I am stuck.
Update: Found this : http://msdn.microsoft.com/en-us/library/ekyft91f(VS.80).aspx Explains how to write a ResX file. Seems like a repeatable process. I am not sure why they would not include a utility with visual studio to create it.
I attempted to use the example of the ResourceWriter. Resgen puked upon using the MS Provided ResourceWriter Class.
Simplified version of a Visual Studios Resx generated file. I have removed Public Token and the Schema mappings. The Schema mapping is to assist you when creating/modifying these files. For demonstration and simplicity I have stripped it out.
For each type byte or string include the following data. Where name is the name you want to access it by and value is eitehr a relative or hard path:
Compile your resource to a single resource manager file and include in your project
You have to create a resource manager in your program to access these files. If you want a strongly typed resource manager you must follow the Resource.Designer class from inside your project and modify that file. If you want a simple resource manager simply use GetString or GetBytes.