Home All Groups Group Topic Archive Search About

Best practice to handle "Resource Only Dlls"

Author
8 May 2007 10:18 AM
zatopek
From the MFC-days we have an app, and depending on the users choice of
international standard and language we load the appropriate resource only dll
and pull the strings and other resources from there. This it not dependent on
neither culture nor O/S.

Is there a good approach to to this in .net? The resources must be in
separate file from the app. In MFC you just set up the dll to be Resource
Only and that was about done.

/Matt

Author
8 May 2007 11:24 AM
Henning Krause [MVP - Exchange]
Hello,

"zatopek" <zato***@discussions.microsoft.com> wrote in message
news:5FEAFBAE-FD07-48A7-A9C4-3F29E889656A@microsoft.com...
> From the MFC-days we have an app, and depending on the users choice of
> international standard and language we load the appropriate resource only
> dll
> and pull the strings and other resources from there. This it not dependent
> on
> neither culture nor O/S.
>
> Is there a good approach to to this in .net? The resources must be in
> separate file from the app. In MFC you just set up the dll to be Resource
> Only and that was about done.

That's the default behavior in .NET. The main language is kept in the
program assembly, and each language gets its own folder under the program
directory, named by the language code.

Best regards,
Henning Krause
Author
8 May 2007 12:24 PM
zatopek
Can I load this dll from somewhere else?
It was easy to just change the culture.

But is it possible to have this dll anywhere with any name and just tell the
app to use it?




Show quote
"Henning Krause [MVP - Exchange]" wrote:

> Hello,
>
> "zatopek" <zato***@discussions.microsoft.com> wrote in message
> news:5FEAFBAE-FD07-48A7-A9C4-3F29E889656A@microsoft.com...
> > From the MFC-days we have an app, and depending on the users choice of
> > international standard and language we load the appropriate resource only
> > dll
> > and pull the strings and other resources from there. This it not dependent
> > on
> > neither culture nor O/S.
> >
> > Is there a good approach to to this in .net? The resources must be in
> > separate file from the app. In MFC you just set up the dll to be Resource
> > Only and that was about done.
>
> That's the default behavior in .NET. The main language is kept in the
> program assembly, and each language gets its own folder under the program
> directory, named by the language code.
>
> Best regards,
> Henning Krause
>
>
Author
9 May 2007 8:36 AM
Mihai N.
> Is there a good approach to to this in .net? The resources must be in
> separate file from the app. In MFC you just set up the dll to be Resource
> Only and that was about done.

You can start from here:
http://msdn2.microsoft.com/en-us/library/z68135h5(VS.71).aspx

Long story short: change the forms property to localizable, and change the
language of the form to the language you want to add.
You should do this for each form, there is no global setting :-(
When you build the resource only dll is created in the proper place and with
the proper name for the resource manager to find it.
In order to use it you will just set the CurrentUICulture to the language you
want.



--
Mihai Nita [Microsoft MVP, Windows - SDK]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email

AddThis Social Bookmark Button