Click here to Skip to main content
15,906,626 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Read the files or folders of a text file and display their icons? Pin
David Crow21-Jan-05 10:12
David Crow21-Jan-05 10:12 
GeneralRe: Read the files or folders of a text file and display their icons? Pin
lillah21-Jan-05 12:34
lillah21-Jan-05 12:34 
GeneralCString to std::string Pin
Patrik Mueller21-Jan-05 0:10
Patrik Mueller21-Jan-05 0:10 
GeneralRe: CString to std::string Pin
Mircea Puiu21-Jan-05 0:32
Mircea Puiu21-Jan-05 0:32 
GeneralRe: CString to std::string Pin
Patrik Mueller21-Jan-05 0:53
Patrik Mueller21-Jan-05 0:53 
GeneralRe: CString to std::string Pin
Mircea Puiu21-Jan-05 1:09
Mircea Puiu21-Jan-05 1:09 
GeneralRe: CString to std::string Pin
Patrik Mueller21-Jan-05 1:24
Patrik Mueller21-Jan-05 1:24 
GeneralRe: CString to std::string Pin
Mircea Puiu21-Jan-05 1:38
Mircea Puiu21-Jan-05 1:38 
Try to use ANSI-To-UNICODE and UNICODE-TO-ANSI string conversions:

   <br />
char *ansistr = "Your text";<br />
int a = lstrlenA(ansistr) + 1;<br />
BSTR unicodestr = SysAllocStringLen(NULL, 2*a);<br />
MultiByteToWideChar(CP_ACP, 0, ansistr, a, unicodestr, a);<br />
// Do something with your string, for example<br />
AfxMessageBox(CString(unicodestr), MB_OK, 0); :-)<br />
// Free the BSTR<br />
SysFreeString(unicodestr);<br />


and

<br />
BSTR unicodestr;<br />
// Get you string somehow<br />
SomeFunction(unicodestr);<br />
int a = SysStringLen(unicodestr) + 1;<br />
char *ansistr = new char[a];<br />
WideCharToMultiByte(CP_ACP, 0, unicodestr, -1, ansistr, a, NULL, NULL);<br />
// Do something with your string, for example<br />
AfxMessageBox(ansistr, MB_OK, 0); <br />
// Free the memory after using the strin<br />
delete[] ansistr;<br />
SysFreeString(unicodestr);<br />



SkyWalker
GeneralRe: CString to std::string Pin
Maximilien21-Jan-05 2:50
Maximilien21-Jan-05 2:50 
GeneralRe: CString to std::string Pin
Emilio Garavaglia21-Jan-05 3:33
Emilio Garavaglia21-Jan-05 3:33 
GeneralRe: CString to std::string Pin
Patrik Mueller21-Jan-05 20:07
Patrik Mueller21-Jan-05 20:07 
GeneralCreating a HDROP object Pin
peluquero8020-Jan-05 23:55
peluquero8020-Jan-05 23:55 
GeneralRe: Creating a HDROP object Pin
Blake Miller21-Jan-05 8:45
Blake Miller21-Jan-05 8:45 
GeneralRe: Creating a HDROP object Pin
peluquero8023-Jan-05 23:23
peluquero8023-Jan-05 23:23 
GeneralRe: Creating a HDROP object Pin
Blake Miller25-Jan-05 4:47
Blake Miller25-Jan-05 4:47 
QuestionHot to get the handle of the main window? Pin
Vaibhav Sanghavi20-Jan-05 23:54
Vaibhav Sanghavi20-Jan-05 23:54 
AnswerRe: Hot to get the handle of the main window? Pin
vikramlinux21-Jan-05 0:56
vikramlinux21-Jan-05 0:56 
AnswerRe: Hot to get the handle of the main window? Pin
Abhi Lahare21-Jan-05 0:59
Abhi Lahare21-Jan-05 0:59 
AnswerRe: Hot to get the handle of the main window? Pin
Blake Miller21-Jan-05 8:49
Blake Miller21-Jan-05 8:49 
GeneralRe: Hot to get the handle of the main window? Pin
Vaibhav Sanghavi23-Jan-05 19:50
Vaibhav Sanghavi23-Jan-05 19:50 
GeneralFonts are scaled while scaling metafile Pin
marukas20-Jan-05 23:42
marukas20-Jan-05 23:42 
QuestionNeed help!!! How to create a connection in Network connections in WinXP? Pin
Chuaaico20-Jan-05 23:42
Chuaaico20-Jan-05 23:42 
GeneralHelp wanted with CRecordset Pin
xcavin20-Jan-05 21:15
xcavin20-Jan-05 21:15 
GeneralRe: Help wanted with CRecordset Pin
David Crow21-Jan-05 10:15
David Crow21-Jan-05 10:15 
GeneralGetKeyState Pin
vidhyas20-Jan-05 17:06
vidhyas20-Jan-05 17:06 

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.