Link to home
Start Free TrialLog in
Avatar of zuckera
zuckera

asked on

how to set wide-char html to CHtmlEditCtrl

Hi,

I've got a WCHAR * variable which holds html with non-english characters in it (could be chinease, turkish, japanese, hebrew, whatever)

I need to get that html into my CHtmlEditCtrl 's document.  So i use:

      CString temp(lpWideCharStr);
      CHtmlEditCtrl::SetDocumentHTML(temp);

Problem is, I see that lpWideCharStr holds the correct value, but temp already has an invalid value (q. marks instead of the characters)

How do i create a CString with the correct value?  if this is not the way to do it, then how??

I need it ASAP so I guess 500 points would be appropriate.

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of nonubik
nonubik

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nonubik
nonubik

CHtmlEditCtrl::SetDocumentHTML requires a LPCTSTR parameter.

 If UNICODE  char set is used, it will be a const wchar_t, if not, will be a const char *.
If you're not using VC++.NET, but VC++6.0, define UNICODE and _UNICODE in your project settings, preprocessor definitions.
Avatar of zuckera

ASKER

Thanks for your response!!

Is there a way to do it locally to the function and not affect the whole project?
Avatar of zuckera

ASKER

ok, your suggestion worked, i didn't use it since it's not an option (the project is too big to change to unicode w/o investing a lot of time in the conversion.)

BUT, I suppose you deserve the points :)