Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ ATL
when i use GetIfEntry to get structure MIB_IFROW ,
i has a wchar array,
then how do i change this array to CString?
 
i test sometimes,but i just get the chars like "??????????"
Posted 12-Dec-11 5:42am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

A WCHAR is a 16 bit character and your CString needs to be the same type. If your program is not being compiled for Unicode then you should use CStringW to ensure it is compatible with the source.
  Permalink  
Comments
Albert Holguin at 12-Dec-11 13:31pm
   
This pretty much sums it up... the CString has to be wide to be compatible.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

it is so sad.
i use CStringW ensure it,but when i display it,it must be a CSting。
so ,it is also "??????????".
how do i change CStringW to CString?
  Permalink  
Comments
Richard MacCutchan at 14-Dec-11 5:23am
   
Why do you need to convert it, you can display CStringW just the same as ordinary CString, as long as you use the wide version of any display function.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web04 | 2.8.1411022.1 | Last Updated 14 Dec 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100