Article View: borland.public.cppbuilder.nativeapi
Article #2132Re: Storing UNICODE in mixed string resource
From: Bob Gonder
Date: Tue, 10 Apr 2007 15:31
Date: Tue, 10 Apr 2007 15:31
34 lines
2027 bytes
2027 bytes
Mike Collins wrote: > So far, we have got all of the roman-based ANSI versions and > copied there captions into a resource file. >The problem that I'm having now is dealing with platforms that use >non-roman, Unicode strings i.e. Hebrew and Russian. How about +always+ using Wide chars? Then you just have to have all your caption resources as wide strings. > char cCaption[255], cClassID[255]; wchar_t wcCaption[255]; char cClassID[255]; > GetWindowText(hWnd, cCaption, sizeof(&cCaption)); GetWindowTextW( hWnd, wcCaption, sizeof(&wcCaption) ); > GetClassName(hWnd, cClassID, sizeof(&cClassID)); GetClassNameA( hWnd, cClassID, sizeof(&cClassID) ); > AnsiString sStoredCaption; WideString wsStoredCaption; > // Load caption from string table resource based on system local > > if ((strcmp(cClassID, "#32770")==0) > &&(strcmp(cCaption, sStoredCaption.c_str())==0)) if ((strcmp(cClassID, "#32770")==0) &&( lstrcmpW( wcCaption, wsStoredCaption.c_str())==0))
Technical Details
Message-ID:
<ns8n13toikgnmrtth262dtekr5qfj8daoo@4ax.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<461b4e2f@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,4f9f4ee974b60660 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: Bob Gonder <notbg@notmindspring.invalid> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Storing UNICODE in mixed string resource Date: Tue, 10 Apr 2007 08:31:04 -0700 Organization: MindSpring Enterprises, Inc. Reply-To: notbg@notmindspring.invalid Message-ID: <ns8n13toikgnmrtth262dtekr5qfj8daoo@4ax.com> References: <461b4e2f@newsgroups.borland.com> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 69.69.88.78 X-Trace: newsgroups.borland.com 1176219062 69.69.88.78 (10 Apr 2007 08:31:02 -0800) Lines: 39 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail