Click here to Skip to main content
15,899,124 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionLoading drivers programmatically Pin
Still learning how to code26-Aug-06 6:58
Still learning how to code26-Aug-06 6:58 
AnswerRe: Loading drivers programmatically Pin
Gary R. Wheeler26-Aug-06 12:28
Gary R. Wheeler26-Aug-06 12:28 
GeneralRe: Loading drivers programmatically Pin
Still learning how to code27-Aug-06 1:42
Still learning how to code27-Aug-06 1:42 
Questionunicode strings Pin
Waldermort26-Aug-06 5:42
Waldermort26-Aug-06 5:42 
AnswerRe: unicode strings Pin
fefe.wyx26-Aug-06 6:32
fefe.wyx26-Aug-06 6:32 
GeneralRe: unicode strings Pin
Waldermort26-Aug-06 7:06
Waldermort26-Aug-06 7:06 
GeneralRe: unicode strings Pin
Pierre Leclercq26-Aug-06 8:55
Pierre Leclercq26-Aug-06 8:55 
GeneralRe: unicode strings Pin
Waldermort26-Aug-06 9:04
Waldermort26-Aug-06 9:04 
Yeah, I figured. I decided to use the ATL macros. But look at this snippet, I can't work it out.
USES_CONVERSION;
// uncompressed text
length *= 2;
char *text = new char [length+1];
memset(text,0,length+1);
WideCharToMultiByte(936/* GB_2312 */,0,(unsigned short *)data,length/2,text,length+1,NULL,NULL);
strings[_added_strings] = new String( A2T(text) );
_added_strings++;
delete[] text;
data += length;

Basically, I am reading from a byte array which contains UTF16 text. Here I am converting it to multibyte, but for a unicode build I want to leave it as it is. Problem is, if I turn that text into a wchar_t and memcpy the bytes over, I get no text. The only way I can do it is to first convert to multibyte, then convert it back to wide.
GeneralRe: unicode strings Pin
Pierre Leclercq26-Aug-06 9:49
Pierre Leclercq26-Aug-06 9:49 
GeneralRe: unicode strings Pin
Justin Tay26-Aug-06 10:08
Justin Tay26-Aug-06 10:08 
AnswerRe: unicode strings Pin
Mike Dimmick26-Aug-06 10:51
Mike Dimmick26-Aug-06 10:51 
GeneralRe: unicode strings Pin
Waldermort26-Aug-06 11:02
Waldermort26-Aug-06 11:02 
AnswerRe: unicode strings Pin
Michael Dunn26-Aug-06 21:37
sitebuilderMichael Dunn26-Aug-06 21:37 
GeneralRe: unicode strings Pin
Waldermort26-Aug-06 22:19
Waldermort26-Aug-06 22:19 
GeneralRe: unicode strings Pin
Michael Dunn26-Aug-06 22:52
sitebuilderMichael Dunn26-Aug-06 22:52 
QuestionLinked list of strings - how to? Pin
jon-8026-Aug-06 4:22
professionaljon-8026-Aug-06 4:22 
AnswerRe: Linked list of strings - how to? [modified] Pin
Dave Calkins26-Aug-06 5:39
Dave Calkins26-Aug-06 5:39 
GeneralRe: Linked list of strings - how to? Pin
jon-8026-Aug-06 7:32
professionaljon-8026-Aug-06 7:32 
AnswerRe: Linked list of strings - how to? Pin
David Crow28-Aug-06 4:33
David Crow28-Aug-06 4:33 
Questionfloat to string Pin
Waldermort26-Aug-06 3:46
Waldermort26-Aug-06 3:46 
AnswerRe: float to string Pin
Mike Dimmick26-Aug-06 9:25
Mike Dimmick26-Aug-06 9:25 
QuestionHooking up Direct3D... but which one ? Pin
seq-26-Aug-06 3:45
seq-26-Aug-06 3:45 
AnswerRe: Hooking up Direct3D... but which one ? Pin
Andy Moore27-Aug-06 10:14
Andy Moore27-Aug-06 10:14 
GeneralRe: Hooking up Direct3D... but which one ? Pin
seq-27-Aug-06 10:49
seq-27-Aug-06 10:49 
QuestionUsing mouse scroll Pin
xkrja26-Aug-06 2:54
xkrja26-Aug-06 2:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.