-
February 28th, 2013, 10:06 AM
#1
HELP: UNICODE conversion sprung up problems with CString & CHARFORMAT2
I converted an old example code (SteveKing's SpellEdit):
SpellEdit[^]
to UNICODE. Also it was made for Visual Studio 7.1 (2003) but I managed to fiddle with it to get it compiling/working under Visual Studio 6.0 (because that's what I have).
Everything is working fine in non-UNICODE. So I converted the project into UNICODE and now I get lots of build errors, such as:
error C2664: 'spell' : cannot convert parameter 1 from 'class CString' to 'const char *'
The whole MySpell library/code uses char * everywhere... and even HunSpell uses char * everywhere too. So how come previously (in non-UNICODE) there was an implicit conversion between CString & const char *, but after changing project to UNICODE I get this error.
PS: This is not problem about converting CString to char * - even though I've tried this, it just doesn't work.
-
February 28th, 2013, 10:23 AM
#2
Re: HELP: UNICODE conversion sprung up problems with CString & CHARFORMAT2
Victor Nijegorodov
-
February 28th, 2013, 10:24 AM
#3
Re: HELP: UNICODE conversion sprung up problems with CString & CHARFORMAT2
Does this mean I have to change the whole of 3rd-party library MySpell & HunSpell?
I thought HunSpell can support UNICODE (because it states it can)... but the source code still works with char *
-
February 28th, 2013, 10:30 AM
#4
Re: HELP: UNICODE conversion sprung up problems with CString & CHARFORMAT2
I have no idea what these 3rd-party library MySpell & HunSpell are and whether they can or cannot support UNICODE.
If they cannot then you will need to convert your unicode strings to ANSI and v.v. using WideCharToMultiByte/MultiByteToWideChar APIs
Victor Nijegorodov
-
February 28th, 2013, 12:08 PM
#5
Re: HELP: UNICODE conversion sprung up problems with CString & CHARFORMAT2
Originally Posted by andwan0
error C2664: 'spell' : cannot convert parameter 1 from 'class CString' to 'const char *'
Converting to Unicode doesn't just mean setting a project option to Unicode. Did you change the libraries also to a Unicode version of the libraries you're using? A library built for ANSI strings cannot magically change into one that handles Unicode strings without some sort of changes, either another version of the library, or the library contains function calls that are Unicode specific, etc.
Regards,
Paul McKenzie
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|