Problem with .rc files in VS 2005

I have several projects that were created with VS 2003.  These are MFC based 
applications with .RC files that contain localized strings.  Some of these 
strings are Japanese, Korean, and Chinese encoded in MBCS.  These projects 
work fine in VS 2003.

I converted these projects to compile with VS 2005 and if I bring up the 
resource editor to view or modify the string resources, VS 2005 will modify 
the Japanese, Korean, and Chinese strings.  It will replace the characters 
with all "?" question marks.

Is there some setting that I need to set to prevent VS from modifying my 
strings?

Here is an example: (Japanese)

String before I open in VS - IDS_ABOUTBOX            "ƒoƒbƒeƒŠî•ñi&Aj..."

String after I open and save in VS - IDS_ABOUTBOX            "??????(&A)..."
0
4/14/2006 10:20:01 PM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
421 Views

Similar Articles

[PageSpeed] 1

> I converted these projects to compile with VS 2005 and if I bring up the 
> resource editor to view or modify the string resources, VS 2005 will modify 
> the Japanese, Korean, and Chinese strings.  It will replace the characters 
> with all "?" question marks.
Normal. I bet this is the same with VS2003. 
The trick it so set the system locales to match the resources you want to 
edit, and do not touch anything else. Make sure you change the system, not 
the user locale: http://www.mihai-nita.net/20050611a.shtml

The other option (which was not available before VS2005) is to convert the 
resources to Unicode (UTF-16), but be carefull to avoid the mistake 
documented here: http://www.mihai-nita.net/20051030a.shtml

-- 
Mihai Nita [Microsoft MVP, Windows - SDK]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email
0
4/15/2006 4:19:28 AM
My resource files contain string tables for serveral lanquages.  So, if I 
change the system locale, will it change the other strings contained in the 
..rc file that are not of that locale.  ie. If I select Japanese to edit the 
Japanese strings, will it modify the Simplified Chinese strings to all 
question marks?

Second, If I try to convert to Unicode, will it convert all the strings to 
Unicode or only the ones for the system locale that I have selected?

"Mihai N." wrote:

> > I converted these projects to compile with VS 2005 and if I bring up the 
> > resource editor to view or modify the string resources, VS 2005 will modify 
> > the Japanese, Korean, and Chinese strings.  It will replace the characters 
> > with all "?" question marks.
> Normal. I bet this is the same with VS2003. 
> The trick it so set the system locales to match the resources you want to 
> edit, and do not touch anything else. Make sure you change the system, not 
> the user locale: http://www.mihai-nita.net/20050611a.shtml
> 
> The other option (which was not available before VS2005) is to convert the 
> resources to Unicode (UTF-16), but be carefull to avoid the mistake 
> documented here: http://www.mihai-nita.net/20051030a.shtml
> 
> -- 
> Mihai Nita [Microsoft MVP, Windows - SDK]
> http://www.mihai-nita.net
> ------------------------------------------
> Replace _year_ with _ to get the real email
> 
0
4/16/2006 3:39:01 PM
> My resource files contain string tables for serveral lanquages.  So, if I 
> change the system locale, will it change the other strings contained in the 
> .rc file that are not of that locale.  ie. If I select Japanese to edit the 
> Japanese strings, will it modify the Simplified Chinese strings to all 
> question marks?
> 
> Second, If I try to convert to Unicode, will it convert all the strings to 
> Unicode or only the ones for the system locale that I have selected?

There is really no safe way to safely handle multiple encodings in one file.
Yoy have several options, but all of them require splitting the file by 
language.

Option 1, recomended: have separate resource files and separate DLLs with 
resources. One DLLs for each language and containing resources only.
This is called "resource only dll" or "satelite dll" and it is the "best 
practice"

Option 2: if for some reason you still have to have all languages in one 
executable/dll

   Sub-option a: each language file with it's own code page
      then at build time, do something like this:
        rc /l 0x409 /c 1252 /english.rc
        rc /l 0x411 /c 932 /japanese.rc
        rc /l 0x804 /c 936 /schinese.rc
        ...
        copy /b english.res+japanese.res+schinese.res lang.res
        link ...

      It might seem that lang.rc with 
        #include english.rc
        #include japanese.rc
        #include schinese.rc
      would do, if you have the proper pragma_codepage and LANGUAGE
      directives in each file, but it does not, due to a bug in rc.exe

   Sub-option b: each language file with it's own code page, convert them
      separately to Unicode (utf-16), then join them back
      This has the advantage than is a one time work and you end up with 
      something very similar with what you have now.


-- 
Mihai Nita [Microsoft MVP, Windows - SDK]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email
0
4/17/2006 7:36:57 AM
Reply:

Similar Artilces:

Print PDF files with margins cut
If I print a pdf file with the source listed below, print out with the trimmed edges. In fact I get a technical drawing with the missing information. The same results if I print from explorer context menu. If I open the pdf file with Acrobat and do printing, the printed sheet is correct. How do I properly print the entire PDF file through code? Thanks Regards i forgot the source that i use: Process proc = new Process(); proc.StartInfo.FileName = "c:\\filo.pdf"; proc.StartInfo.Verb = "Print"; proc.StartInfo.CreateNoWindow = true; proc.StartInf...

HTML Help not closing the file
I am using HTML Help to display help information within my Excel program. After I close HTML Help, the file system thinks that the .chm file is still being accessed, and I cannot overwrite the file (although the HTML Help process is closed). Here is the code that I have to open: Call HtmlHelp(0, ActiveWorkbook.Path & "\MyHelp.chm", HH_DISPLAY_TOPIC, 0) or Call HtmlHelp(0, ActiveWorkbook.Path & "\MyHelp.chm", HH_HELP_CONTEXT, 1001) and to close: Call HtmlHelp(0, 0, HH_CLOSE_ALL, 0) ...

Bank reconciliation problem
I have a foreign currency checkbook and cash account. The cash account doesn't match the balance for the checkbook. I've looked at the individiual transactions and they seem to make senes, so any advice on wehre to look would help. thx if this is the first time you reconcile this checkbook, the dif could be opening balance. "cimino172@gmail.com" wrote: > I have a foreign currency checkbook and cash account. The cash account > doesn't match the balance for the checkbook. I've looked at the > individiual transactions and they seem to make senes, so any a...

Can publisher 2003 open files from publisher 2000
I had an e-mail sent to me with an attatchment of publisher 2000 and I have just installed publisher 2003 and I can't open it. 2003 will open 2000 documents. Disable "script blocking" if you have Norton and Office Plug-ins in Norton options and try again. -- Mary Sauer MS MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "melboy" <melboy@discussions.microsoft.com> wrote in message news:B133C378-2FB0-4DEA-95F6-B7AF9F3378A0@microsoft.com... >I had an e-mail sent to me with an attatchment of publisher 2000 and I have > j...

Apology for insuffient data on IE problems
I've never post to a forum before so I let my other half do it for me, and for that I am sorry. My problem started 2 days ago when IE 7 quit opening internet pages. I have a Dell laptop running windows XP Professional. I am using a verizon mifi for the internet. Intel Wireless WiFi Link 4965AGN is the wireless that cam with the laptop. IE7 was working fine, then 2 days ago it started bringing up a page saying internet explorer cannot display internet page. And this: ('Customize Your Settings' (http://go.microsoft.com/fwlink/?LinkId=74005)) is what is in the address ...

Exchange vs Sharepoint
Currently using GP 8.0. I will be purchasing a new HP DL380, 2.0, 8 Geg ram. I need to share Outlook calenders. I have no need for Exchange mail functions (I use a pop server). I have a small business and I do not need any of Sharepoint's "workflow" features. In relation to the new capabilities of GP version 10, what are the benefits of purchasing Exchange with out Sharepoint? Thank you. Your comment "I have no need for Exchange mail functions (I use a pop server). " sort of sums it up. That is what Exchange does, email. And if you have no use for Sharepoint...

System.OutOfMemoryException on Large Files)
hello, I get XXX when I run the following code (if and only if the outcome of transformation is beyond 20 MB) With _Xslt .Load(XslFile) .Transform(XmlDocument, Nothing, MyWriter, Nothing) End With If I run this in .NET 2.0 Beta 2, it gets on and it's much faster as well. If run the same on MSXML 4.0, it's works and it's much faster too. Is this a known issue in .NET 1.1 ? Is there a way around it? or do I have to switch to MS XML 4.0 for now? -- Mohammed Banat Mohd Banat wrote: > I get XXX when I run the ...

problem with filename.msg
Hi, I have a file called passwords.msg. It contains all of my online passwords. It has always appeared as a note on my taskbar. Although it is still there, whenever I click to open it, I get the message that outlook has performed an illegal operation and will shut down. Any way to retrieve this file? Thanks, jo ...

Recovery of ASD files
My computer crashed and was in the middle of working on two Word files. When I rebooted and started Word I was not given the automatic auto recovery function. I did find the auto recovery (.asd) files and made copies and renamed as .wbk files. I could not open either .asd or .wbk files ("Word cannot open because unsupported file type"). Is there a way to open these files in Word? I was able to open in notepad but most of the data inside the file was not readable. Thanks. ...

SHRINKDATABASE vs. SHRINKFILE
First off, I am of the Tibor school of shrinking files, however, after going through the 2008 SHRINKDATABASE and SHRINKFILE docs, I'm curious what the community thinks of SHRINKDATABASE (when the operation is necessary). Personally, I prefer the granularity and extra control of SHRINKFILE, but the "do it in one step" of SHRINKDATABASE seems appealing. Comments? Jay, I trust you didn't expect to pose such a question here without me jumping in <g>. I definitely prefer SHRINKFILE. SHRINKDATABASE is to... uncontrolled. You specify how much free ...

Saving files automatically
Hi, I have a macro to save a number of different versions of my file for different budget holders. When this is run, it recognises that the file already exists and prompts to allow it to be overwritten. Is there some VBA I can add to accept the prompt automatically? Thanks Richard application.displayalerts = false 'your code to save application.displayalerts = true Richard Burton wrote: > > Hi, > > I have a macro to save a number of different versions of my file for > different budget holders. When this is run, it recognises that the file &g...

2006 from 2005 install problem?
Money 2006 Deluxe has made me an instant millionaire!! It converted my 2005 file fine -- no complaints, but at least in one of my accounts the balance is grossly inflated -- doesnt even match the sum of the entries in the account. I have looked at all transactions and their details -- they match the line entries I have done Quick and standard file repair -- nothing changes -- Log says no broken records This sucks I would like to go back to 2005 -- but of course it was uninstalled by 2006 Anyone experience such a problem -- solution? Thanks In microsoft.public.money, ulall wrote: >Mo...

Greylisting problem #3
We're having a problem with e-mail sent to recipients outside of our organisation where the recipient mail server is using greylisting. When our system receives the first greylisting response, it resends, as expected. However, it then gets another greylisting response. I thought that a greylisting system should accept any subsequent sends? An example of SMTP log entries is as follows: 2007-02-23 12:19:35 TheirIP2 OutboundConnectionResponse SMTPSVC1 OurServer - 25 - - 220+TheirServer2.TheirDomain+ESMTP+Exim+4.43+Fri,+23+Feb+2007+12:19:29++0000 0 0 69 0 30110 SMTP - - - - 2007-02-23...

seem to have deleted 'file' and 'edit' from my menu in Word 2008
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel I'm not entirely sure how I have done this! But I cannot seem to get either file or edit to appear on my Word menu, it basically just starts off with 'view'. <br><br>Any help much appreciated!!! In the View menu select Customize Toolbars & Menus. On the Toolbars & Menus page click the name of the Menu Bar, then click the Reset button & see if things are put right when you OK out. -- HTH |:>) Bob Jones [MVP] Office:Mac <Richy78@officeformac.com> wrote ...

problems sending/receiving emails Exchange 2003 SP2
Ok, let me first start by saying that I know I've committed several sins in this process, but I need to know what to do to get this fixed. Before my problems began I was running Win2000 Server SP4 w/ Exchange 2003 SP1. This server is a DC in the domain, and this is the only Exchange server in the domain. For sake of discussion we'll call the server SERVEREXCH Today, because I'm an idiot I was looking at installing DNS on the server and saw that IIS SMTP and NNTP were installed, so I removed them. This proceeded to be the beginning of the end. Soon after doing this the Exchange...

Use of hexadecimal 0x1d in XML Visual studio 2005
Hello group, I have an XML file with a sample as <message name="E51&#29;SG22" />. This XML uses the ascii 29 character. In Visual studio 2003 IDE this document opened without any errors, but in VS 2005 i get an error Character ' ', hexdecimal value 0x1d is illegal in XML documents. How should be able to rectify this problem?. Anyway for a quick solution that doesn't break the schema Thanx in advance Suraj ...

Office 98 Office Manager Problem #3
Hello Folks. This is my first post here. System: Powerbook G3 Series 1999 running Mac OS 9.2.2 Installed Office 98 from original CD after cleaning hard drive. "Customize..." in Office Manager menu does nothing. Opening Microsoft Office Manager Control Panel does nothing. Any ideas please? Am I missing a file from value pack? Thanks. Gordon F. Howell ghowell(NOSPAM)@princemusictheater.org or GFHowell(NOSPAM)@aol.com Did you use to be able to customize the Office manager for Office 98? I had this problem with your same configuration and never solved it, but I was very un-computer-sa...

Does anyone have Money 2005 trial still available?
Does anyone have a backup of money 2005 _trial_ lying around? I do - contact me offline. Why do you need it? -- Glyn Simpson, Microsoft MVP - Money http://money.mvps.org/ Check http://money.mvps.org/faq/ for tips and fixes for MS Money. To send Microsoft your product wishes see http://money.mvps.org/wishes.aspx I do not respond to any unsolicited email regarding Money "Tux" <tusharsg@gmail.com> wrote in message news:1127207209.002448.6660@g49g2000cwa.googlegroups.com... > Does anyone have a backup of money 2005 _trial_ lying around? > Yeah - i have it too if y...

Checking if files open prior to running macro
Is it possible to check if a number of files are open prior to running a macro that pulls data from the required files. After testing with a file open, Excel does not prompt you that the files is already open but when trying to save the files to overwrite the original the macro falls down. Thanks in advance!!! This is a repost--newsreader problems. But I did want to add that if you're using xl2k or higher, you can remove the split97 function and just change this line: mySplit = Split97(FileNameToCheck, "\") to mySplit = Split(FileNameToCheck, "\") (Split was a...

problem #3
Hi I have a problem in excel when i try to import data from MSSql with Import external data: I must use the same condition in two places in the same query..something like that: select col2 from d where col1=? union select col3 from d where id not in (select col2 from d where col1=?) this query works perfectly in MSSql, but when I try to do this in my ".dqy" file the excel tell me I have an error in my sql... pls help me ...

DX50 Codec ? Change file preferences in WMP 9?
Hello, Recently re-installed XP Pro after a bad MB. I am still using WMP 9 and I get messages saying I need a "DX50" codec to play some files. Even though these same file types were listed when I installed the program. Two questions..... 1/ Where do I get the DX50 codecs ( that are guaranteed to work ) :) 2/ Where in WMP 9 can I DESELECT some of the file types I chose when I first ran it? I can't seem to find that option anywhere in the program. Thank you, Tinsby Tinsby wrote: > 1/ Where do I get the DX50 codecs ( that are guaranteed to work...

Delimited Files
Can anyone please tell me what these are and how to fix them. Thanks Les. A delimited file is a file that has a character separating fields (or columns). A common example would be a comma separated file (CSV). When used with Excel, you can tell Excel what the delimiter in the file is and Excel will separate the file fields into columns. (With CSV files, Excel assumes it's delimited by commas). You'd need to be more specific as to the problem as far as fixing one goes. >-----Original Message----- >Can anyone please tell me what these are and how to fix them. > &g...

Problem creatting charts with VBA
In Excel 2007, when I create a new chart using Charts.Add I get a chart that has all the series of a previously created chart. How can I prevent this? I want a clean slate. I know that in the past I could not avoid having at least one series when creating a chart. I simply redefine the attributes of series one. And this seems to be true of 2007 as well. TheWizEd - Jon Peltier's web page, "Quick Excel Chart VBA Examples," might be useful, at http://peltiertech.com/Excel/ChartsHowTo/QuickChartVBA.html Note that he uses ChartObjects.Add instead of Charts.A...

The stupid budget and transfers problem and brokerage accounts
I found the incredibly stupid fix at http://support.microsoft.com/default.aspx?scid=kb;EN- US;80453 for trying to make transfers show up in budget reports the right way - however I move money around in my brokerage account a lot and there is no way to use that workaround with the investment account because you can't split a transaction in there. Can anyone think of another workaround? My budget just shows $18000 transfers out of budget accoutns so the reports show me as grossly exceeding my budget. This is so stupid, another Microsoft screw-up! Does Quicken deal with this stuff a...

FileSearch dislikes Zip-files
L.S. FileSearch doesn't report zip-files. Executing the Macro you'll find below, does not list the zip-files that reside in the specified directory. Replacing the FileName "*.zip" by "*.*" lists all files except the zip-files. I've reviewed the contents of the collections PropertyTests and FileTypes, but could not get any results. Using the interactive version at the Excel-sheet, via the menu-options, I got the same results. Kind regards, Hub van de Laar Private Sub ListZipFiles() Dim FS As FileSearch, I As Integer With Application.FileSearch ...