Unicode in MFC

Hi,
I am new to MFC programming and I have a problem:
when I try to write the caption of a button or something else in my
own language(Farsi), in the design mode it shows the correct string
but when I compile it it shows a '?' instead of every character. Can
anyone please help me with that.

0
2/9/2007 8:04:25 AM
vc.mfc 33608 articles. 0 followers. Follow

4 Replies
772 Views

Similar Articles

[PageSpeed] 19

> I am new to MFC programming and I have a problem:
> when I try to write the caption of a button or something else in my
> own language(Farsi), in the design mode it shows the correct string
> but when I compile it it shows a '?' instead of every character. Can
> anyone please help me with that.

My psychic guess is that you are seeing this bug:
  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
2/9/2007 8:43:09 AM
Fascinating!  Too bad such convoluted effort is necessary to do what VS should be already
doing...but, hey, we need to destroy the IDE first, before we make anything work as it
should...
				joe
On Fri, 09 Feb 2007 00:43:09 -0800, "Mihai N." <nmihai_year_2000@yahoo.com> wrote:

>> I am new to MFC programming and I have a problem:
>> when I try to write the caption of a button or something else in my
>> own language(Farsi), in the design mode it shows the correct string
>> but when I compile it it shows a '?' instead of every character. Can
>> anyone please help me with that.
>
>My psychic guess is that you are seeing this bug:
>  http://www.mihai-nita.net/20051030a.shtml
>:-)
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15973)
2/9/2007 4:00:22 PM
On Feb 9, 7:00 pm, Joseph M. Newcomer <newco...@flounder.com> wrote:
> Fascinating!  Too bad such convoluted effort is necessary to do what VS should be already
> doing...but, hey, we need to destroy the IDE first, before we make anything work as it
> should...
>                                 joe
>
> On Fri, 09 Feb 2007 00:43:09 -0800, "Mihai N." <nmihai_year_2...@yahoo.com> wrote:
> >> I am new to MFC programming and I have a problem:
> >> when I try to write the caption of a button or something else in my
> >> own language(Farsi), in the design mode it shows the correct string
> >> but when I compile it it shows a '?' instead of every character. Can
> >> anyone please help me with that.
>
> >My psychic guess is that you are seeing this bug:
> >  http://www.mihai-nita.net/20051030a.shtml
> >:-)
>
> Joseph M. Newcomer [MVP]
> email: newco...@flounder.com
> Web:http://www.flounder.com
> MVP Tips:http://www.flounder.com/mvp_tips.htm

Thanks Mihai,It worked perfectly!!!!!!!!!!!!

0
2/9/2007 5:40:33 PM
> Too bad such convoluted effort is necessary to do what VS should be already
> doing...but, hey, we need to destroy the IDE first, before we make anything
> work as it should...
Then maybe you did not read this one:
  http://blogs.msdn.com/michkap/archive/2007/01/16/1476857.aspx
:-)


-- 
Mihai Nita [Microsoft MVP, Windows - SDK]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email
0
2/10/2007 4:27:31 AM
Reply:

Similar Artilces:

Which control should I use to display Unicode characters?
Hi, there, I want to show Unicode characters, such as Chinese and Arabic. Which control should I use? Could you please give me a bit of example code? Thanks a lot. Gary You do not need specific control to display Unicode strings. Normally, you would use SetWindowText function to set the control text. If you look in winuser.h file this 'function' #defined as SetWindowTextA or SetWindowTextW (depending on the type of the build). If you want to use Unicode text regardless of build type, specify SetWindowTextW explicitly. Note that you need to have appropriate fonts installed to a...

MFC ActiveX: ExitInstance is only called in debugger
I created a MFC-based ActiveX control. Now, when the browser is closed, I want to perform some initialization task in method 'ExitInstance'. This works, but only in debugging mode. Otherwise, this method is not called at all, when the browser is closed. What's the reason? Whats the right MFC-method in order to initialize the control? Thanks and regards, Thomas When you say "only in debugging mode" do you mean whenyou are running one of the ActiveX test containers, or some program that exercises your control? You probably need to ask this in one of the Ac...

unicode application
hi, Priyanka here, this is a question related to VB. i want to make the VB application unicode based. i am not able to do it right now. if anybody knows please let me know about this. ...

interrupt driven programming with MFC
Hi, I want to write a interrupt driven program with VC++ 6.0/7.0 .Can any one help? Reny Since the concept of interrupts does not exist in user space, the answer is "there is no way to do this". If you want to talk to an I/O device, you have to write a device driver. If you are using obsolete software like Win9x/Me, you have to write a VxD, an art that is fast fading into the obscurity it deserves. For real operating systems (the NT family), you need to write a device driver. You will need the Windows DDK (available from Microsoft, or included in the MSDN). The obsolete systems ha...

Brother MFC 8420 compatibility with Windows XP
I have a Brother MFC 8420 which serves as my printer. I am running Windows XP 2002 Home Edition and whenever i try to turn my computer off, it gets as far as "Windows is shutting Down" and stops. It does not shut down unless I have turned my MFC off before starting the shut down. any one have any ideas? Thanks. That is the wrong kind of MFC. This MFC group is for programming using Microsoft Foundation Classes. Try here: http://www.brother.com/library/websites/www.com/top_new/support/index.htm AliR. "Sam Goodbaum" <SamGoodbaum@discussions.microsoft.com>...

VERIFY and TRACE, how to implement for debug/release, unicode-aware, no warnings at lvl 4
Hi group and apologize because this isn't a pure MFC-question. I have to finish a raw win32 app written in C++. I really miss the macros TRACE and VERIFY, which I tend to use when writing MFC programs. I googled for "win32 verify macro" and the very first hit is for a codeproject.com project with implementations to be used in a win32 program, however. The project contains a single header file, debug.h, but it doesn't compile without warnings (using warning level 4), doesn't seem to be unicode aware and doesn't compile at all in release mode. I was just wonderin...

MFC and User Defined objects
Greetings, I am trying to PostMessage from a user defined generic class/object in MFC Dialog based application to Dialog/main window. I don't know how to do that. I am utilizing worker threads. A thread instantiates an object(from user defined generic class) and utilizes newly created object. What user defined object code does is actually launch a process, for sake for argument lets say, Windows Notepad.exe using CreateProcess. As long as that process is running, I want to PostMessage that updates a progress bar on Main GUI dialog. I can do it if I embed the code right into my appli...

Unicode
I want to make an application for international use which should all languages(which unicode support). So i want to know how to change language? or in ther words, how to change my Locale( at run time). ...

MFC Update sample apps
Hi, I've downloaded and installed the 'feature' pack for VS2008, but I can't find the sample applications advertised in the help file. Does anyone know where they've been hidden? Cheers, Steph http://msdn2.microsoft.com/en-us/library/482ck6x8.aspx ? Tom "Steph" <steph@newsgroups.nospam> wrote in message news:BE0856C9-A417-4BCC-ABED-3F8DE8E9ADBC@microsoft.com... > Hi, > > I've downloaded and installed the 'feature' pack for VS2008, but I can't > find the sample applications advertised in the help file. > > Does anyone...

How to convert to unicode in ADSI
Hi all, I made a vbs to add an extra e-maill address to a distribution list group. The e-mail address should be <group name>@dnv.com. As we are a Norwegian company, the group name sometimes contains Norwegian character such as "Ø". When I look into ADSI, the string with "Ø" do updates in "mail" attribute. But if I want to send e-mail to this distribution goup, error will report that "The format of the e-mail address is incorrect". I found if I manually create the e-mail address, the system will automatically convert ...

XML parser in MFC? #2
hi, Priyanka here. can we have XML parser in MFC? thanks and regards, Priyanka Hi. Look here. http://www.codeproject.com/soap/markupclass.asp ...

Convert MFC .exe to ActiveX (ocx dll)
Any ideas how to do that? I've created an MFC app with buttons, comboboxes and other controls and now I need to convert it to ocx control to put it easily in some other apps, but only mfc .exe apps not for web. [sadam] > I've created an MFC app with buttons, > comboboxes and other controls and now I need to convert it to ocx > control to put it easily in some other apps, but only mfc .exe apps > not for web. MFC gives good support to OCX development. I would suggest you to use MFC AppWizard to create a new OCX project, then you can reuse your old existing MFC app code, ...

ftpd unicode
In Wince 5.0 file and folder names may contain UNICODE (e.g. cyrillic or chinese)characters. I was not able to transfer such files via FTP. I think it is a problem of ftpd. Any suggestions ? Tank you You've got full source code of FTPD, so clone it (see my blog) and change it to whatever you need, or buy a 3rd party FTP implementation for CE. Note that FTPD is shipped as "Sample" meaning it's not a full featured final program. Good luck, Michel Verhagen, eMVP Check out my blog: http://GuruCE.com/blog GuruCE Microsoft Embedded Partner http://...

Opening CSV file(saved in unicode) in excel
Hi, If anyone can help me on this, I would really appreciate that. I have a file that is saved in .csv extension (Unicode format). Let's say for example, I have the data as follows: "text1","text2",123,"text3",450.00 When I save the above data in .csv (in Ascii format) and open in excel file, I see that each value is placed in adjacent columns. When I save the same data in .csv (Unicode) I see the whole information appears in the single cell(first cell only). Is there a limitation to the CSV FILE opening in EXCEL, with Unicode format? Any inputs/...

MFC DLL vs. Win32 DLL + MFC (small size is important)
I've noticed that there is smaller size of DLL when created like Win32 DLL project and then linked MFC as static lib, then when it is created as MFC DLL project. Is this truth? I'm trying to make my dll as smaller as possible. ...

unicode format files for Outlook 2002
I use Outlook 2002. I would like to use Unicode files (for larger size). I see references to using it with Outlook 2003, but none for 2002. can unicode files be used with Outlook 2002? If so, how? thanks, Huck No OL 2003 & 2007 only "Huck Rorick" <huckrorick@groundwork.org> wrote in message news:epYUYAl4IHA.2348@TK2MSFTNGP06.phx.gbl... >I use Outlook 2002. I would like to use Unicode files (for larger size). >I see references to using it with Outlook 2003, but none for 2002. can >unicode files be used with Outlook 2002? If so, how? > > than...

Clipboard for Unicode and Non-Unicode
Hi all, We have a progarm write with non-unicode. I found that in some language, the character can not be pasted to CEdit correctly. For example, if our application is running on Russian XP, the string copy from IE can be pasted to CEdit properly. But if I pasted the same string into Notepad, and then copy the string from notepad to our CEdit, the string can not show corectly. Is it a coding problem? Is it possible to make CEdit to accept the string from notepad? Thanks, Justin If it is a question of pasting a UTF16 string into a single-byte edit control, you could try it in two stages: L...

How do you enter Unicode characters that don't have a Alt-nnnn shortcut?
I have a need to enter a range of non-English names into a combo box on a form in an Access 2003 application. Sometimes this requires the use of accented characters that do not appear on a UK keyboard. If I refer to the Windows XP Character Map facility (charmap,.exe) then I can see that many such foreign characters have been allocated an Alt-nnnn code that is displayed at the bottom right of the Character Map acreen. This makes it easy to enter these characters. However, many other characters have not been given an Alt-nnnn keyboard shortcut. They only have a U-FFFF code, displayed at...

Unicode problem
Given the following code snippet: WNetOpenEnum( dwScope, 0, 0, NULL, &hEnum ); struct hostent *host; DWORD Count = 0xFFFFFFFF; LPVOID Buffer = new char[16384]; DWORD BufferSize = 16384; WNetEnumResource(hEnum, &Count, Buffer, &BufferSize); NetResource = (NETRESOURCE *) Buffer; for (int i = 0; i < Count; i++, NetResource++) { CString strFullName = NetResource->lpRemoteName; ... host = gethostbyname((LPCTSTR) strFullName); } This works when I do *not* have _UNICODE and UNICODE defined. When I *do* define those directives, I get a compiler error on the call to the...

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: *...

create csv which contains unicode
i want to create csv which contains unicode can anyone help me out Requirement is not clear. Use Excel to create the unicode content and then save as CSV or Unicode txt format. "archana" wrote: > i want to create csv which contains unicode > can anyone help me out ...

printing UNICODE and convert CString to UNICODE
1.how do i convert some CString to UNICODE ? ? ? i search in MSDN and i dont understand how to do it . 2. i writing some program and i need to send some CString to printing . in my CString there is some local language (not eanglish) and the printer always give me some GIBRISH data. pleace , someone can help me ?? ? tanks. For 1: Use MultiByteToWideChar() Or, Use a CStringW and initialise it from your CString. For 2: You will need to give more information about how you are getting your text to the printer. You should be getting a device context for the printer and use DrawText or a ...

Handling UNICODE #2
Hello, again Here is another problem (at least for me). In the edit control non-English string is displayed properly. There is a member variable for this control, of a CString data type. My question is - how to assign this non-English string to this variable? I mean when I'm calling UpdateData(TRUE), in Debug the value for this member data is "??????" and also when I'm reading recordset, which returns this non-English value properly, (I can see it running corresponding stored procedure in Query Analyzer), the variable of a type _bstr_t, which receiving the value also look...

Localization of my MFC application
Hi There, We have an application which has an exe and uses two MFC extension DLLs (our own) and we intend to localise. My plan is to use what is called 'satellite Dlls' to hold all the resources that the exe file and the two extension DLLs use. I know in the exe file, I can do the following to load the resource DLL: CMyApp::InitInstance() { // one of the first things in the init code HINSTANCE hInst = LoadLibrary("myres.dll"); if (hInst != NULL) AfxSetResourceHandle(hInst); // other initialization code would follow . . . } How could I achieve ...

How do I fill data into mfc combo-box control in VS2008
In VS6.0, I could simply type in strings each seperated by Alt+Enter. In VS2008, I cannot input strings in property frame. How do I do that? -- Daewon YOON Type each of the strings separated by a semi-colon in the Property "Data". - Shoaib "TheOne" <daewon.yoon@gmail.com> wrote in message news:559afad2-d866-4798-bb0f-f5d59e3887c1@w8g2000prd.googlegroups.com... > In VS6.0, I could simply type in strings each seperated by Alt+Enter. > > In VS2008, I cannot input strings in property frame. How do I do that? > > -- > Daewon YOON > "The...