Click here to Skip to main content
15,888,329 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: memory allocation for class object Pin
Hamid_RT13-Oct-08 21:22
Hamid_RT13-Oct-08 21:22 
AnswerRe: memory allocation for class object Pin
Hamid_RT13-Oct-08 21:27
Hamid_RT13-Oct-08 21:27 
AnswerRe: memory allocation for class object Pin
CPallini13-Oct-08 22:30
mveCPallini13-Oct-08 22:30 
Questionerror C2660: 'VarBstrCmp' : function does not take 4 parameters [modified] Pin
lee2313-Oct-08 19:33
lee2313-Oct-08 19:33 
AnswerRe: error C2660: 'VarBstrCmp' : function does not take 4 parameters Pin
CPallini13-Oct-08 23:17
mveCPallini13-Oct-08 23:17 
GeneralRe: error C2660: 'VarBstrCmp' : function does not take 4 parameters Pin
lee2314-Oct-08 12:27
lee2314-Oct-08 12:27 
GeneralRe: error C2660: 'VarBstrCmp' : function does not take 4 parameters Pin
CPallini14-Oct-08 22:25
mveCPallini14-Oct-08 22:25 
Questionhelp at MultiByteToWideChar Pin
monsieur_jj13-Oct-08 17:13
monsieur_jj13-Oct-08 17:13 
Hi all,

I need your help in my code I got from the gsoap article of Dr. Luigi here is his code:

CString CMyCurrencyConvertor::GetSoapError()
{ 
    struct soap *pSoap = m_pCurrencyConvertor->soap;
    CString sError;
    if (soap_check_state(pSoap ))
        sError.Format("Error: soap struct not initialized\n");
    else
    {
        if (pSoap->error)
        { 
            const char *pFaultCode, *pFaultSubCode = NULL, *pFalutString, 
                **iFaultCode;
            iFaultCode = soap_faultcode(pSoap );
            if (!*iFaultCode)
                soap_set_fault(pSoap );
            pFaultCode = *iFaultCode;
            if (pSoap ->version == 2)
                pFaultSubCode = *soap_faultsubcode(pSoap );
            pFalutString = *soap_faultstring(pSoap );
            iFaultCode = soap_faultdetail(pSoap );
            sError.Format("%s%d fault: %s [%s]\"%s\"Detail: %s", 
                pSoap->version ? "SOAP 1." :\
            "Error ", pSoap->version ? (int)pSoap->version : pSoap->error, 
                pFaultCode, \
            pFaultSubCode ? pFaultSubCode : "no subcode", 
                pFalutString ? pFalutString : "[no reason]", \
            iFaultCode && *iFaultCode ? *iFaultCode : "[no detail]");
        }
    }
    return sError;
}


Now as per his advise is used MultiBytetoWideChar as the sError being returned is in japanese/chinese.

I modified his code into this:


sError.Format(_T("%s%d fault: %s [%s]\"%s\"Detail: %s"), 
pSoap->version ? "SOAP 1." :\
"Error ", pSoap->version ? (int)pSoap->version : pSoap->error, 
pFaultCode, \
pFaultSubCode ? pFaultSubCode : "no subcode", 
pFalutString ? pFalutString : "[no reason]", \
iFaultCode && *iFaultCode ? *iFaultCode : "[no detail]");

MultiByteToWideChar( CP_ACP, 0, CT2A(sError),
strlen(CT2A(sError))+1, wszFaultString,   
sizeof(wszFaultString)/sizeof(wszFaultString[0]) );


Now my problem is that once it is converted instead of the words i am expecting i get question marks example is
fault: ????? but it should be fault: host not found.

What should I do?

Thanks,
Jayjay
AnswerRe: help at MultiByteToWideChar Pin
Iain Clarke, Warrior Programmer13-Oct-08 17:39
Iain Clarke, Warrior Programmer13-Oct-08 17:39 
Questiontrouble using dll Pin
gargeug13-Oct-08 14:57
gargeug13-Oct-08 14:57 
AnswerRe: trouble using dll Pin
Mark Salsbery13-Oct-08 15:06
Mark Salsbery13-Oct-08 15:06 
QuestionRe: trouble using dll Pin
CPallini13-Oct-08 22:17
mveCPallini13-Oct-08 22:17 
AnswerRe: trouble using dll Pin
gargeug14-Oct-08 7:27
gargeug14-Oct-08 7:27 
QuestionSetup Wizard Question Pin
Rangarajan Varadan13-Oct-08 8:44
Rangarajan Varadan13-Oct-08 8:44 
AnswerRe: Setup Wizard Question Pin
Iain Clarke, Warrior Programmer13-Oct-08 17:44
Iain Clarke, Warrior Programmer13-Oct-08 17:44 
GeneralRe: Setup Wizard Question Pin
Rangarajan Varadan14-Oct-08 16:56
Rangarajan Varadan14-Oct-08 16:56 
Questionmap of lists of pointers Pin
Laan8213-Oct-08 7:05
Laan8213-Oct-08 7:05 
QuestionRe: map of lists of pointers Pin
David Crow13-Oct-08 7:39
David Crow13-Oct-08 7:39 
AnswerRe: map of lists of pointers [modified] Pin
Laan8213-Oct-08 7:57
Laan8213-Oct-08 7:57 
AnswerRe: map of lists of pointers Pin
Jason Hamilton14-Oct-08 5:04
Jason Hamilton14-Oct-08 5:04 
Questionhelp: how to integrate third party lib to my MFC Extension DLL. Pin
lyjqhjcplusplus13-Oct-08 4:59
lyjqhjcplusplus13-Oct-08 4:59 
AnswerRe: help: how to integrate third party lib to my MFC Extension DLL. Pin
Roger Stoltz13-Oct-08 5:39
Roger Stoltz13-Oct-08 5:39 
GeneralRe: help: how to integrate third party lib to my MFC Extension DLL. Pin
lyjqhjcplusplus13-Oct-08 5:57
lyjqhjcplusplus13-Oct-08 5:57 
AnswerRe: help: how to integrate third party lib to my MFC Extension DLL. Pin
Roger Stoltz13-Oct-08 6:17
Roger Stoltz13-Oct-08 6:17 
GeneralRe: help: how to integrate third party lib to my MFC Extension DLL. Pin
lyjqhjcplusplus13-Oct-08 6:34
lyjqhjcplusplus13-Oct-08 6:34 

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.