Re: CString to const char*

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi Abdo,

IIRC, CString has no function to convert Unicode characters to ASCII ones.
However you can use mbtowc() or MultiByteToWideChar() to do the job

Excellent thanks, I shall use one of these methods.

BTW, you can use TCHAR instead of char and use your normal functions
(MessageBox instead of MessageBoxA) and avoid all the hassle...

Unfortunately I do not have control over the methods being called, i.e. the
socket functions, or are there TCHAR equivilents?

Nick.


.



Relevant Pages

  • Re: CreateProcess
    ... If the process calls MessageBox function, how to avoid the message window ... > the error message showing on the desktop? ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Invalid access to memory location for X86_Microsoft.Windows.Common-Controls.... COMCTL32.dll
    ... solution is to use a taskModal MessageBox ... ... If you can get away with using a taskModal MessageBox you can avoid ... the base image to make the inProc option easier to access. ... MessageBoxes and inProc Dialogs. ...
    (comp.lang.smalltalk.dolphin)
  • Re: CString to const char*
    ... (MessageBox instead of MessageBoxA) ... and avoid all the hassle... ... Unfortunately I do not have control over the methods being called, i.e. the socket functions, or are there TCHAR equivilents? ...
    (microsoft.public.vc.language)
  • Macro : confirm Delete
    ... Then a messagebox appears to confirm to delete the data. ... How can I klick "Delete" automatically (or avoid this ...
    (microsoft.public.excel.programming)
  • Re: Detect when ActiveForm changes
    ... instantiated outside of my application (e.g., MessageBox or UITypeEditor ... motivation of this question was to avoid doing that. ...
    (microsoft.public.dotnet.languages.vb)