Click here to Skip to main content
15,887,477 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Saving configuration option data Pin
ThatsAlok14-Sep-05 23:53
ThatsAlok14-Sep-05 23:53 
GeneralRe: Saving configuration option data Pin
karmendra_js15-Sep-05 0:25
karmendra_js15-Sep-05 0:25 
AnswerRe: Saving configuration option data Pin
ThatsAlok15-Sep-05 0:57
ThatsAlok15-Sep-05 0:57 
GeneralRe: Saving configuration option data Pin
David Crow15-Sep-05 7:41
David Crow15-Sep-05 7:41 
AnswerRe: Saving configuration option data Pin
Ashok Dhamija15-Sep-05 1:28
Ashok Dhamija15-Sep-05 1:28 
AnswerRe: Saving configuration option data Pin
Achim Klein15-Sep-05 8:52
Achim Klein15-Sep-05 8:52 
JokeRe: Saving configuration option data Pin
ThatsAlok15-Sep-05 18:06
ThatsAlok15-Sep-05 18:06 
QuestionUniCode To Ansi Conversion problem Pin
fjlv200514-Sep-05 23:24
fjlv200514-Sep-05 23:24 
I have a problem with conversion, when i ran the code below, it gives me the error :
Error : ERROR_INVALID_PARAMETER (refer to trace code below).. Whats wrong with my code?

By the way Im using Embedded Visual 3, where the default setting of my Project is Unicode...
I have my own CSoString which is the same with CString but in plain C format ANSI and have some additional features in it. I want to convert first from unicode to ansi so that the converted ansi will be passed to CSoString like for ex.
CSoString mystring;
mystring.Copy(char* here); // where the char* is the converted Unicode to ANSI.

but before i copy it, i have to fix the problem with conversion....

Pls. see code below..


Thanks and More pOwer.

------------------------------------------- Code ----------------------------------------

CString m_wordSearchText; // this variable is a cstring of edit box.
LPSTR hold=0;
LPSTR hold2=0;
int len=WideCharToMultiByte(CP_ACP,0,(LPCWSTR)m_wordSearchText,-1,hold,0,NULL,NULL);
if (len==0)
{
DWORD lerror=GetLastError();
switch(lerror)
{
case ERROR_INSUFFICIENT_BUFFER :
{
TRACE(_T("ErrorLen : ERROR_INSUFFICIENT_BUFFER\n")); break;
}
case ERROR_INVALID_FLAGS :
{
TRACE(_T("ErrorLen : ERROR_INVALID_FLAGS\n")); break;
}
case ERROR_INVALID_PARAMETER :
{
TRACE(_T("ErrorLen : ERROR_INVALID_PARAMETER\n")); break;
}
}
}
else
{
WideCharToMultiByte(CP_ACP,0,(LPCWSTR)m_wordSearchText,len,hold,len,NULL,NULL);
DWORD lerror=GetLastError();
switch(lerror)
{
case ERROR_INSUFFICIENT_BUFFER :
{
TRACE(_T("Error : ERROR_INSUFFICIENT_BUFFER\n"));
break;
}
case ERROR_INVALID_FLAGS :
{
TRACE(_T("Error : ERROR_INVALID_FLAGS\n"));
break;
}
case ERROR_INVALID_PARAMETER :
{
TRACE(_T("Error : ERROR_INVALID_PARAMETER\n"));
break;
}
}
}

TRACE2("UniCodeWord=%s ConvertedWord=%s\n",m_wordSearchText,hold);
AnswerRe: UniCode To Ansi Conversion problem Pin
Jack Puppy15-Sep-05 1:11
Jack Puppy15-Sep-05 1:11 
GeneralRe: UniCode To Ansi Conversion problem Pin
fjlv200515-Sep-05 15:58
fjlv200515-Sep-05 15:58 
Questionwarning for compiler option /GX Pin
logicaldna14-Sep-05 23:12
logicaldna14-Sep-05 23:12 
QuestionGPRS Pin
_tasleem14-Sep-05 23:11
_tasleem14-Sep-05 23:11 
AnswerRe: GPRS Pin
ThatsAlok15-Sep-05 18:09
ThatsAlok15-Sep-05 18:09 
QuestionHuffman Encoding Pin
edurach14-Sep-05 22:29
edurach14-Sep-05 22:29 
AnswerRe: Huffman Encoding Pin
Rage14-Sep-05 22:41
professionalRage14-Sep-05 22:41 
QuestionSimulate post at webpage Pin
Daniel Strigl14-Sep-05 22:10
Daniel Strigl14-Sep-05 22:10 
QuestionRenaming Tree Nodes Pin
laiju14-Sep-05 20:41
laiju14-Sep-05 20:41 
QuestionWhat is the Anotomy of Encarta? Pin
shoaibnawaz14-Sep-05 20:30
shoaibnawaz14-Sep-05 20:30 
AnswerRe: What is the Anotomy of Encarta? Pin
vikas amin14-Sep-05 21:36
vikas amin14-Sep-05 21:36 
QuestionHow to print the page for right of screen !!! Pin
ebinaini14-Sep-05 19:51
ebinaini14-Sep-05 19:51 
QuestionHow to wait for thread & if no response within time abort it Pin
karmendra_js14-Sep-05 19:32
karmendra_js14-Sep-05 19:32 
AnswerRe: How to wait for thread & if no response within time abort it Pin
PJ Arends14-Sep-05 19:52
professionalPJ Arends14-Sep-05 19:52 
GeneralRe: How to wait for thread & if no response within time abort it Pin
karmendra_js14-Sep-05 21:05
karmendra_js14-Sep-05 21:05 
GeneralRe: How to wait for thread & if no response within time abort it Pin
HumanOsc14-Sep-05 21:59
HumanOsc14-Sep-05 21:59 
GeneralRe: How to wait for thread & if no response within time abort it Pin
David Crow15-Sep-05 7:43
David Crow15-Sep-05 7:43 

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.