[omniORB] Problems with string and double variable.

Luke Deller ldeller at xplantechnology.com
Thu Oct 28 19:59:55 BST 2004


concat833 at yahoo.com wrote:
> In the client application, I did:
> try{}
> catch(ACI::ENotAvailable& ex)
> {
> cerr << *ex.strMessage;
> }
> The strMessage is define with a full message by the server developer, 
> but from the client side, I got only the first character of the 
> strMessage.

Why do you use the * operator?  This is what causes only the first 
character to be printed.  To get the whole string you should use:
     cerr << ex.strMessage;

> And another problem with double variables.
> doubleSeq_var values; // doubleSeq is defined as a sequence of double.
> When I get the values, I print it out (cout << values[0];), it's really 
> a double (eg 5.123). But if I put it in a double:
> double val = values[0];
> cout << val << endl;
> In this case, val is not really a double but only the integer part of 
> it. (val = 5). Does anyone know why?

Sorry I can't spot that one.

Regards,
Luke.



More information about the omniORB-list mailing list