Thank you very much Ismail, I'll try it and let you know.
But, there is something catching my attention, when we have included the web
service in our C++ program we saw that the function "HelloWorld" needs a
paramater as "BSTR* HelloWorldResult" and returns a “HRESULT” value.
Inspecting the parameter we found the “H” letter and according with the
source code the “HRESULT” notifies the status of the function. This is the
way how we are calling the function.
BSTR* myOwnHello;
int myOwnSize = (int) sizeof( BSTR* );
HRESULT myOwnResult = InitializeSOAP( NULL );
myOwnHello = (BSTR*) malloc( myOwnSize );
myOwnResult = HelloWorld( myOwnHello );
If ( FAILED( myOwnResult) )
{
return “ERROR consuming the web service”;
}
return (const char*) myOwnHello;
Reading in other places we found that the function "VectorFromBstr(...)" is
the solution but does not works too. Any way, I'll try first your solution
and let you know.
Thank you again.
"ismailp" wrote:
You receive a unicode string.
To get ASCII string, use W2A macro. Here is how to use it.
USES_CONVERSION; // you need this to use W2A macro
CMyWebService svc; // your service.
LPTSTR lpszOutput = W2A(svc.HelloWorld());
USES_CONVERSION macro is defined in atlconv.h, if it is not already
included (I don't think so - it should already be included).
after obtaining lpszOutput, you can copy it, duplicate it, or do
whatever you want (except returning that).
Ismail Pazarbasi