Which makes no sense at all. Machines don't care what high-level language you used to create the application. As long as the binary matches the target platform, you're good to go. Now if you wanted to compile C++ code on a Linux box, that's a different animal altogether.
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
I developed a VC++ application and now I need to support UNICODE to show Hebrew strings into a CListCtrl. I added the declaration:
but now I obtain several error during the compilation process:
error C2664: 'int ATL::CStringT<basetype,stringtraits>::Find(ATL::CSimpleStringT<basetype,t_bmfcdll>::XCHAR,int) throw() const' : cannot convert parameter 1 from 'const char ' to 'ATL::CSimpleStringT<basetype,t_bmfcdll>::XCHAR'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
This is because I used string constants without the _T("..."); prefix.
In my application there are several strings without _T prefix so I wanted to know if exist a workaround to use UNICODE without the intoruduction of _T prefix.
Firstly defining just "_UNICODE" is not enough - You need to define both "UNICODE" and "_UNICODE". "UNICODE" effects the Windows headers and "_UNICODE" the C runtime library. Make sure you "undefine" (remove) any "MBCS" defines. It would be best to make these definitions by altering the project settings and not be putting "#define"s in your code. Other peoples comments on the use the the "_T" or "_TEXT" macros apply.
Also in MFC the width of toolbar is same as the toolbar resource/static control where we place the toolbar. But in SDK the displayed toolbar width is higher. How to set/fix size of tool bar in SDK. What could be the trouble in Win32 SDK way? any suggestions???
By this question, i clearly mean to say that "My application needs to be Unicode-Aware". Just adding the 'UNICODE' directive is enough? (I did that but when I pasted unicode text in one edit box of my app, it showed ??? and not the unicode text)
What are the necessary steps (Linker directives, etc) that I should take to make sure that my app works fine with Unicode and is completely Unicode-Aware?
I know I should use all "W" functions and should place literal strings within _T.
Any pointers or help in this direction is highly appreciated.
What is the significance of adding UNICODE / _UNICODE? It's actually now I removed _UNICODE and added UNICODE, the app still understands unicode. I kept both UNICODE AND _UNICODE, the app still works with unicode. I don't understand this. Can someone explain me in detail? I went through The msdn documentation regarding the same, but didn't get it. (In all the cases I had to define an entry point by myself i.e. entry:wBlah, otherwise the compiler gave a bitter error complaining _WinMain@16 is an unresolved external symbol!)
the two macros exist, but not manages the same places. so, the best way to handle unicode fully is to define the 2 macros this way (in stdafx.h for instance) :
<font color=green>//stdafx.h file// used for precompiled headers...</font>
<font color=blue>#define</font> _UNICODE
<font color=blue>#define</font> UNICODE
<font color=green>// the other includes...</font>
I will tell you in sequence what happened. First I added 'UNICODE' ( in project-settings ). The app was unaware of unicode (displayed ???). I added _UNICODE and suddenly the compiler gave me a bitter error that _WinMain@16 is an unresolved external symbol. I had to give my entry, i.e. entry:"wWinMainCRTStartup". I really dont know why I had to do this, but after this only it compiled, and the program worked with unicode. I did not assign any unicode font also, to the edit control. What is the significance of this "wWinMainCRTStartup"? and is that if i assign a unicode font to the edit control it can still go ahead to be unicode aware without defining _UNICODE and my own entry point "wWinMaainblahblah"?
Is there a way to convert RTF string to plain text?
Putting a string into CRichEditCtrl using Callback StreamIn and then getting it out using CRichEditCtrl::GetWindowText seems overly complicated and doesn't work in my case, since GetWindowText returns null unless you've displayed the string (UpdateData(FALSE)) and it doesn't support unicode (or at least I've been unable to get it working).
Just stripping RTF codes wouln't do since unicode rtf uses some strange character encoding.
If you know how to do it I'd really appreciate. (I think I've read something about coping it into clipboard and then getting plain text, but can't find it..)