Re: C++ type conversion question

Fabian Schmied <[email protected]> Tue, 5 Dec 2006 09:19:43 +0100
Newsgroups gmane.comp.windows.devel.dotnet.cx
Message-ID <[email protected]>
> I have a TCHAR* referencing a string and I want to get that data into a
> WCHAR []

This seems very offtopic, it doesn't have anything to do with .NET.
Maybe ask at a VC++ newsgroup?

TCHAR is a macro either defined as WCHAR or as CHAR, depending on
whether the UNICODE symbol is defined in your application.

This means that TCHAR* might be a WCHAR* or a CHAR*. In the first
case, copying to a WCHAR[] is trivial (wcscpy or wcscpy_s). In the
second case you can use one of the Ansi-to-WChar conversion functions
(e.g. A2W, MultiByteToWideChar), as described here:
http://support.microsoft.com/kb/138813/en-us .

Fabian

===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com