Click here to Skip to main content
15,904,415 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How can i remove spaces in my database ? Pin
_AnsHUMAN_ 25-Sep-06 23:49
_AnsHUMAN_ 25-Sep-06 23:49 
AnswerRe: How can i remove spaces in my database ? Pin
Waldermort26-Sep-06 0:11
Waldermort26-Sep-06 0:11 
AnswerRe: How can i remove spaces in my database ? Pin
David Crow26-Sep-06 3:06
David Crow26-Sep-06 3:06 
QuestionAbout printer queue Pin
hsdok25-Sep-06 22:56
hsdok25-Sep-06 22:56 
QuestionRe: About printer queue Pin
David Crow26-Sep-06 3:08
David Crow26-Sep-06 3:08 
QuestionHow to correctly create a UNICODE tstring from a char[]? Pin
BarryOg25-Sep-06 22:56
BarryOg25-Sep-06 22:56 
AnswerRe: How to correctly create a UNICODE tstring from a char[]? Pin
Nibu babu thomas25-Sep-06 23:05
Nibu babu thomas25-Sep-06 23:05 
AnswerRe: How to correctly create a UNICODE tstring from a char[]? Pin
Steve S26-Sep-06 0:08
Steve S26-Sep-06 0:08 
To properly convert, you can use the MultiByteToWideChar() function, and to go the other way, you can use WideCharToMultiByte(). These will convert between ANSI/MBCS and UNICODE and vice versa.

You can use casts as much as you like to convince the compiler, but the data stays the same.

WCHAR buf[_MAX_PATH];
#if !defined(UNICODE)
int n = MultiByteToWideChar(CP_ACP, 0,
filename.c_str(), filename.length(),
buf, _MAX_PATH);
if (n>=0)
{
buf[n] = L'\0';
}
#else
wcscpy(buf, filename.c_str());
#endif
D3DXGetImageInfoFromFile(buf, &Info);

Steve S
Developer for hire

GeneralRe: How to correctly create a UNICODE tstring from a char[]? Pin
BarryOg26-Sep-06 4:01
BarryOg26-Sep-06 4:01 
GeneralRe: How to correctly create a UNICODE tstring from a char[]? Pin
Steve S27-Sep-06 1:34
Steve S27-Sep-06 1:34 
GeneralRe: How to correctly create a UNICODE tstring from a char[]? Pin
BarryOg29-Sep-06 3:37
BarryOg29-Sep-06 3:37 
QuestionThread + Serial communication? Pin
Sunshine Always25-Sep-06 22:50
Sunshine Always25-Sep-06 22:50 
AnswerRe: Thread + Serial communication? Pin
Roger Stoltz25-Sep-06 23:25
Roger Stoltz25-Sep-06 23:25 
QuestionFont problem Pin
mikobi25-Sep-06 22:36
mikobi25-Sep-06 22:36 
AnswerRe: Font problem Pin
Hamid_RT25-Sep-06 23:24
Hamid_RT25-Sep-06 23:24 
AnswerRe: Font problem Pin
Steve S26-Sep-06 0:01
Steve S26-Sep-06 0:01 
AnswerRe: Font problem Pin
mikobi26-Sep-06 20:40
mikobi26-Sep-06 20:40 
GeneralRe: Font problem Pin
Steve S27-Sep-06 1:40
Steve S27-Sep-06 1:40 
GeneralRe: Font problem Pin
mikobi28-Sep-06 0:30
mikobi28-Sep-06 0:30 
AnswerFont problem Pin
mikobi26-Sep-06 20:57
mikobi26-Sep-06 20:57 
QuestionProcess dependencies Pin
nmx_de25-Sep-06 21:46
nmx_de25-Sep-06 21:46 
AnswerRe: Process dependencies Pin
nutkase25-Sep-06 23:31
nutkase25-Sep-06 23:31 
GeneralRe: Process dependencies Pin
nmx_de25-Sep-06 23:47
nmx_de25-Sep-06 23:47 
GeneralRe: Process dependencies Pin
nutkase26-Sep-06 0:02
nutkase26-Sep-06 0:02 
AnswerRe: Process dependencies Pin
Hamid_RT25-Sep-06 23:39
Hamid_RT25-Sep-06 23:39 

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.