To clarify about the above… What I am trying to do is pass some base64 encoded binary data from a client to a server. (The sample code in the project has a client retrieving from a server.) Also, if in an XmlRpcValue method you do this:;
value.asBinary = new BinaryData((char*)value, ((char*)value)+nBytes);
}
you get a runtime error "unhadled exception at 0x…. … .std::bad_alloc at memory location 0x…..
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Originally, XmlRpc++ was created with VC++ 6.0, and this "error" was hidden by the compiler. Please, check the help files from VS 2008 about the compiler error C2664 for a complete explanation. Unfortunatelly, I use XmlRpc++ still in the VC++ 6.0 environment, and I can not test it.
Quique
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When trying to compile this code snippet:
void *pData = new char(length);
infile.read(pData, length);
XmlRpcValue data((void*) pData,(int) length);
I get the following compiler error in VS 2008:
1>c:\ism\isecureme\xmlrpc++0.7_vs2008\test\sendjpegtest\sendjpegtest.cpp(40) : error C2664: 'std::basic_istream<_Elem,_Traits>::read' : cannot convert parameter 1 from 'void *' to 'char *'
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>
1> ]
1> Conversion from 'void*' to pointer to non-'void' requires an explicit cast
This confuses me as I see the following constructor in XmlRpcValue.h:
XmlRpcValue(void* value, int nBytes) : _type(TypeBase64)
{
_value.asBinary = new BinaryData((char*)value, ((char*)value)+nBytes);
}
So what gives? Why won't the compiler use this constructor?
Thx,
Tom
To clarify about the above… What I am trying to do is pass some base64 encoded binary data from a client to a server. (The sample code in the project has a client retrieving from a server.) Also, if in an XmlRpcValue method you do this:;
value.asBinary = new BinaryData((char*)value, ((char*)value)+nBytes);
}
you get a runtime error "unhadled exception at 0x…. … .std::bad_alloc at memory location 0x…..
Originally, XmlRpc++ was created with VC++ 6.0, and this "error" was hidden by the compiler. Please, check the help files from VS 2008 about the compiler error C2664 for a complete explanation. Unfortunatelly, I use XmlRpc++ still in the VC++ 6.0 environment, and I can not test it.
Quique