Standard MFC controls behave different when showing polish characters

Hello all,

I have a rather simple to describe but difficult to solve problem.
Our customers want to use our ANSI MFC program to show different
languages.
For example Polish.
When I set the font for the different controls they behave different.

For example the CEdit shows the polish characters just right but the
CButton with checkbox style shows glyphs instead of the special
characters.
Every control that is owner draw and uses for example the DrawText()
function of the device context shows the characters right.

I've experimented with _UNICODE for the display part and everything I
could think of but cannot find a solution.
Where is the difference, or what can I do (beside making all controls
owner draw) to get all controls display the same text?

What is the difference between standard control drawing or
CDC:DrawText(..)?

It is no option to rewrite all the text manipulating functions to use
the UNICODE counterparts. Because the program is half C and half C++.
It would take several weeks to work over all the source code to rewrite
everything to UNICODE and not to speak of testing everything all over
again.

Any ideas?

Thanks,
whiteman

0
schnee (2)
10/26/2006 1:58:42 PM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
512 Views

Similar Articles

[PageSpeed] 58

>When I set the font for the different controls they behave different.

How are you setting the font for the controls?

>For example the CEdit shows the polish characters just right but the
>CButton with checkbox style shows glyphs instead of the special
>characters.

What's different about how you set the font's for those controls?

>Every control that is owner draw and uses for example the DrawText()
>function of the device context shows the characters right.
>
>I've experimented with _UNICODE for the display part and everything I
>could think of but cannot find a solution.

Have you got both _UNICODE and UNICODE defined?

Which OS are you testing on?

>It is no option to rewrite all the text manipulating functions to use
>the UNICODE counterparts.

OK, so you're stuck with a non-Unicode application. Presumably your OS
is set up to support Polish correctly? Do other applications display
those characters correctly or not?

Dave
0
davidl7375 (2060)
10/26/2006 5:53:05 PM
If the string is Unicode you may want to try using SetWindowTextW() to set 
the button's text.  If the text is ANSI SetWindowText() will work OK.  You 
may not be able to use the typical DDX stuff to put a Unicode string on an 
MBCS button since it wouldn't translate it correctly.

Tom

<schnee@pks.de> wrote in message 
news:1161871122.416576.297190@m73g2000cwd.googlegroups.com...
> Hello all,
>
> I have a rather simple to describe but difficult to solve problem.
> Our customers want to use our ANSI MFC program to show different
> languages.
> For example Polish.
> When I set the font for the different controls they behave different.
>
> For example the CEdit shows the polish characters just right but the
> CButton with checkbox style shows glyphs instead of the special
> characters.
> Every control that is owner draw and uses for example the DrawText()
> function of the device context shows the characters right.
>
> I've experimented with _UNICODE for the display part and everything I
> could think of but cannot find a solution.
> Where is the difference, or what can I do (beside making all controls
> owner draw) to get all controls display the same text?
>
> What is the difference between standard control drawing or
> CDC:DrawText(..)?
>
> It is no option to rewrite all the text manipulating functions to use
> the UNICODE counterparts. Because the program is half C and half C++.
> It would take several weeks to work over all the source code to rewrite
> everything to UNICODE and not to speak of testing everything all over
> again.
>
> Any ideas?
>
> Thanks,
> whiteman
> 


0
tserface (3861)
10/26/2006 9:25:28 PM
Tom Serface wrote:
> If the string is Unicode you may want to try using SetWindowTextW() to set
> the button's text.  If the text is ANSI SetWindowText() will work OK.  You
> may not be able to use the typical DDX stuff to put a Unicode string on an
> MBCS button since it wouldn't translate it correctly.
>
> Tom
>

I'm setting the font like this:

	aButton.SetFont( kCfgAttr.GetFont() );

And setting the text with:

	aButton.SetWindowText(_T(aString));

The text I set is always ANSI because the underlying socket layer is
completely written using ANSI functions.

What puzzles me is why does this

    pDC.DrawText(strText, LeftAlignRect,
DT_SINGLELINE|DT_LEFT|DT_VCENTER);

work and the normal CEdit also but most other controls do show glyphs?
Where is the conversion taking place?

I already tried converting the Text to UNICODE with
MultiByteToWideChar() but that didn't help me either.

I'm glad about any hint or idea you could give me.

Thanks,
whiteman

0
schnee (2)
10/27/2006 7:29:39 AM
Reply:

Similar Artilces:

Developing on a CRM3 server in a different domain
Hi there Alongside our current CRM3 server which has our live company data, I have created a ghost machine which holds a CRM3 server for the purpose of developing CRM solutions for clients. I have installed this CRM3 server on a different domain. I am trying to write a post-callout on this server using Visual Studio .NET on my development box which is located on our main company domain. However, when adding a Web Reference I can't seem to find the correct address for the web reference. I updated this CRM3 development server from a CRM1.2 server image I had set up for this particular clie...

Tab control question about updates
Searched but couldn't see this discussed. I have a form with 5 tabs. Data can be loaded three ways, manually entered, imported from a text file, and imported from a Word template. On one of the tabs (the second) when the user enters information such as a social sec. number (SSN) that matches a file already in the system, a flag goes off and alerts the user. Works fine. On the import functions, the data is loaded and appears correctly, but when the user moves to the second tab where the SSN number appears, it does not set off the flag when the page opens. I can make it happen with a c...

Exchange/Outlook Groups not showing in Entourage
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Power PC Email Client: Exchange I work in a PC environment. Our organization uses Exchange Server and Outlook. I use a Mac and Entourage. My Common Contacts book shows all the email addresses but none of the GROUPS show up. Therefore I am unable to send emails from Entourage to GROUPS within the organization. These groups show up just fine in OUTLOOK. Also in Outlook the EMAIL TYPE for address show as SMTP while GROUPS are EMAIL TYPE: MAPIPDL <br><br>Our IT is pretty swamped with other issues to be able find...

Installing office 2007 student over a standard trial
My computer came pre-installed with a copy of Microsoft office, I don't' recall which version, but it is expired and had Excel, OneNote, PowerPoint, and Word. I've signed up for night school courses, and the school lets students download and install Office 2007 as a perk. Do I need to remove the trial before running the installer? Also, I've heard that Office 2003 and 2007 can coexist. I currently have my old copy of office 2003 installed on Virtual PC with my old copy of Windows XP professional, can I have both available on the host OS? How would I set that up?...

too many different formatting cells
I can't open an excel document because whem I try to open it says that too many different formatting cells. How to resolve this and open this document? Maybe... XL: Error Message: Too Many Different Cell Formats http://support.microsoft.com/default.aspx?scid=213904 A few people have said that OpenOffice.Org has been able to open the file. Then they clean it up and save it there. Then excel can open that cleaned up version. http://www.openoffice.org, a 60-104 meg download or a CD jo wrote: > > I can't open an excel document because whem I try to open it says that too >...

Big difference in performance
I wrote a class on which I perform unit-testing before integration in the main development line, the unit-testing and main dev being two separate projects. I wrote a routine which constructs a data structure in the class, which uses CArrays, vectors, and the nth_element routine from STL, with the routine being recursive. Now, in the unit-test project, the routine takes ~3-4 seconds to execute. In the main development code, it takes ~70 seconds to execute. This is measured for the routine itself (no setup or cleanup), same data as input, same computer, and both projects compiled for debug. ...

Formulas showing in cell???
I keep getting a formula showing in the cell after I edit i (occasionally). Show formulas is turned off and edit in cell is on. How can I make the formula go awaw and simply show the results whic when edited the results shows correctly? -- Message posted from http://www.ExcelForum.com Hi probably the cell is formated as 'Text' change the cell format to 'General' and re-enter your formula -- Regards Frank Kabel Frankfurt, Germany > I keep getting a formula showing in the cell after I edit it > (occasionally). Show formulas is turned off and edit in cell is on. >...

Difference between XML templates and Active Reports
Why does RMS use XML templates (for receipts and P.O.s) and for most other reports Active Reports? I realize that the XML receipts can not be changed or resorted on the preview screen, but why use not all active reports? Active reports are based on formating the results of a SQL Query - if you can work out the SQL to get the result set you want, you can create almost any report you want. The XML Templates are based on objects internal to RMS, like the current transaction for reciept printing, the active PO or Transfer request for PO prining, or a given customer for Statements. Y...

show pictures in a form
i am trying to make a database and i have a record that has a hyperlink to a picture i have two question 1) is the hyperlink the best choice to use for the picture 2) how do i make the picture visble on a form thank you for your help sorry i sent this to the wrong newsgroup how every any advice would still be appreciated "William Storey II" <billstorey@sbcglobal.net> wrote in message news:zguub.30991$TL5.30867@newssvr25.news.prodigy.com... > i am trying to make a database and i have a record that has a hyperlink to a > picture > > i have two question > &g...

when I type a long number it shows up as smaller number and +
when converting from xls to csv format, some of my longer mortgage numbers get condensed into a smaller number with a letter, a plus sign and another number. example: 100020013120 turns into 1.0002E+11. Any way to get rid of this? Thanks, Yes, just specify the format that you want. Format Cells...>Number>0 decimal places Regards, Fred "SandyC" <SandyC@discussions.microsoft.com> wrote in message news:FA52E426-360E-4BE5-B63B-1209E673CA65@microsoft.com... > when converting from xls to csv format, some of my longer mortgage numbers > get conde...

Users not showing up??
I'm having trouble adding users and mailboxes in Exchange 2003. My Exchange 2003 box is connected to a Windows 2003 DC. On the Exchange box, whenever I add a user in the Active Directory, it shows up as an account, and all the Exchange tabs are assigned to the user....however under Exchange System Manager no mailbox is created...even though I've run Exchange Tasks in the AD on that same box. Is it because I have to somehow sync the AD on the Exchange box to the DC, or is it something else? Please help!! On Mon, 8 Aug 2005 15:42:02 -0700, "Scott S." <ScottS@discussio...

Money 2000 Standard Check Printing
When I try to print a company check I get the error message "There are no checks to print in the "Absolute Audio Provident Bank" account. Money will only print checks for transactions that have "Print" in the number field." Everything I've tried to print has already had "Print" in the number field and it still won't print. Where should I go from here? Try repairing the file by closing Money, then go to Start, Run and type 'msmoney -s' without the quotes. Money should launch and repair. Then try to print checks again. "Just...

Suddenly not able to save new or open previous files with name lengths over 45 characters
I'm using Excel 2003 if it matters ... I'm wondering if there is a known bug/issue on this. For what ever reason, when I try to save a new file (or for that matter open something done previously) with a name that has more than 45 characters or so (might be off by a couple), I get message that it can't save and then gives me a bunch of reasons (file path might not exist, might have too many characters, folder might be read only, etc). I know file exists in the folder I'm checking - I can email myself the file and open from the email so its definitely there! Any sane insight? ...

No "Sender" or "Subject" showing
Suddenly, about 1/2 of the messages downloaded have no Sender or Subject showing, and the message displays in HTML coding. Any clue what's causing this? WLM Support Windows Live Solution Center for Windows Live Mail http://windowslivehelp.com/product.aspx?productid=15 Windows Live Mail Forums http://windowslivehelp.com/forums.aspx?productid=15 Windows Live Mail Solutions http://windowslivehelp.com/solutions.aspx?productid=15 -- ....winston ms-mvp mail "alsmithfl" wrote in message news:785170FE-56BD-4ACD-9CA3-A2934E476650@microsoft.com... Sud...

Pasting "Character Spacing" adjusted text
Our church office secretary has the Bible on a CD in a Word document. They have used Format>Font>Character Spacing>Position >Raised>by 2.5 rather than "Suberscript" for all the verse numbers. Is there a way to Copy the text and paste it into Publisher to maintain the appearance of the raised verse numbers? I do not see the Character Spacing formatting features in Publisher. We are using Office 2002. Jim wrote: > Our church office secretary has the Bible on a CD in a Word document. > They have used Format>Font>Character Spacing>Position >Raised>...

CSV file with 13space characters in blank cells
In my office we've just received a recurring report which has been modified (by someone. Previously (a CSV file) the Data area (say A1:M30 ) had numbers or blank cells representing 0 (zero) values. Now, however the blank cells ARE NOT BLANK (although they appear blank) all cells without numbers have 13 hard-space values in them, which is causing #VALUE! problems; I temporarily added an intermediate sheet with formula: =IF(ISNUMBER(VALUE(MySheet!B2)),MySheet!B2,0) to eliminate the #Value! problem; Is there a better way? I'm sure there is, just not certain at this point in time. Any ...

How to assign value to controls on a Report
I am trying to assign value on a txtbox control from a form to a txtbox control on a report. Form txtbox control:txtBeginDateRange Report txtbox control:txtStartDate reportName = "Report by DR and Vendor" I am have a problem with this line of code Reports![reportName]!txtStartDate = Me.txtBeginDateRange DoCmd.OpenReport reportName, acViewPreview Any help will be appreciated. Thank you. Ayo. Answered in another post where you asked the same question. ...

Chart Legend Items: hide/show
How do I hide/show a series on a chart legend (scatter plot.) I tried a null string (""), but the trace still shows. I also tried #N/A. But it then shows "#N/A"; the same with function: NA(). What I am trying to do is to have a control button to show or hide a series from the chart. I can set all the series values to #N/A which hides it, but I am having trouble trying to hide the legend for the series. I also tried an "if" function in the chart->series dialog, but It evidently will only accept a cell pointer. "Jon Peltier" <jonREMOVExlmvp@p...

MFC, ATL
Hi folks, My last works with C++ under Windows was prior to MFC, nowadays I need to get some programming using MFC and ATL. For that I need to understand what is correct the Visual Stidio C++ IDE version that supports CImage and CImageDC classes, what is the MFC version and if the corresponding MFC DLLs are included with W2000 and XP. I have a W2000 Server that does not have a new MFC setup. Please advise, thanks, Carflos If I were just starting back up with Visual Studio I jump right in at 2005 (especially since V2003 had a lot of problems and V6 isn't really available much any m...

Entourage Reminders showing dates for next month overdue
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Power PC Email Client: pop Recently my reminder window has been showing me events as overdue, but upon looking closer find the date showing as next months events. Why are late December dates showing as overdue in November. The are events that occur monthly and are set up to remind 2 to 3 days in advance. On Nov 26, 5:24=A0pm, tankmas...@officeformac.com wrote: > Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Power = PC Email Client: pop Recently my reminder window has been showing me events= a...

MFC and OSX?
We're getting ready to do a Mac OSX port of our MFC applciation, and managaement wants to consider a direct port, via some sort of framework that will use MFC code to create native OSX binaries. Are there any toolkits that willl support Windows code in a Mac environment? Please note that - I am not asking about emulators (WINE, etc); these are known quantites and not what we're asking about. - No need to mention the ancient and execreble Mac toolkit that Microsoft produced in the 4.x days; I've used it; it's not relevant. TIA -- Jim Johnson My Mac programmer say: *...

Standard Toolbar Customise won't hold.
OL 2000, Internet only, XP. I wonder if anyone can help me ... an MVP maybe? I have on several occasions recently painstakingly Customized my Standard Toolbar only to have it revert to its default state on closing and reopening again. Other Toolbars that I unchecked reappear. It never used to do that. What did I do? Denzil. Best to start with a new outcmd.dat file. Close Outlook, rename outcmd.dat to .old (use search and enable hidden files). Then reopen Outlook, customize the default toolbar to your liking. Close Outlook. Find and COPY the outcmd.dat file to a safe location in case ...

Office System 2010: List of Controls IDs
Does anyone know when or where Microsoft will publish a list of control IDs for the Office System 2010? Does anyone know the idMso for the "Print" command located on the new "File" menu? -- Greg Maxey See my web site http://gregmaxey.mvps.org for an eclectic collection of Word Tips. Arrogance is a weed that grows mostly on a dunghill (Arabic proverb) This is a multi-part message in MIME format. ------=_NextPart_000_000B_01CAE7B4.9D78F540 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable...

IF two different conditions are met
How do I enter a formula where two different conditions have to be met? I have a date in G3 and either "complete" or "incomplete" in H3. I wan to put a formula in I3 that states if G3 has a date and H3 i "complete" then return "Yes" otherwise return "No". Can it be done -- Message posted from http://www.ExcelForum.com Hi try =IF(AND(ISNUMBER(G3);H3="complete");"Yes";"No") -- Regards Frank Kabel Frankfurt, Germany > How do I enter a formula where two different conditions have to be > met? > > ...

Member Server to Domain Controller
Hi How do I promote a member server running Windows 2003 Server SP2 and Certificate Services to a domain controller. Regards Use the system command dcpromo Check out the link below http://www.petri.co.il/how_to_install_active_directory_on_windows_2003.htm -- Paul Bergson MVP - Directory Services MCITP - Enterprise Administrator MCTS, MCT, MCSE, MCSA, MCP, Security +, BS CSci 2008, Vista, 2003, 2000 (Early Achiever), NT4 Microsoft's Thrive IT Pro of the Month - June 2009 http://www.pbbergs.com Please no e-mails, any questions should be posted in the NewGroups. ...