Click here to Skip to main content
15,907,677 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys, I am using Microsoft Vissual C++ 6.0 SP6 MFC for my projects. & I created a simple SDI with Document/View support project. & I want to make it possible to switch the interface language (EN/FR for example) from the menu in just one click using the CArchive serialization class. and also save the latest used language interface for the next application restart.

How to do this? :confused: Help me please :sigh:

NB: All the application phrases are CString class type
Posted
Updated 1-Dec-10 8:13am
v2

Just implement the following class :) :
class CYouMainFrame;

class CInterfacePhrases
 : public CMapStringToString /*PhraseKey <-> PhraseValue*/
{
  DECLARE_SERIAL(CInterfacePhrases);

private:
  UINT m_uiLanguage;

protected:
  CInterfacePhrases();

public:
  CInterfacePhrases(UINT uiLanguage);
  virtual ~CInterfacePhrases();

  bool Exchange(CYouMainFrame* pcFrame, bool bGet /*or Set*/);

  void GetStorageFileName(CString& cszFileName);
  virtual void Serialize(CArchive& ar);
};
 
Share this answer
 
tomay3000 wrote:
I want to make it possible to switch the interface language (EN/FR for example) from the menu in just one click using the CArchive serialization class.


There are several ways for dynamically switching user interface language (you may use, for instance, XML files to store localized strings). I don't think the CArchive class has a major role in that.
:)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900