[omniORB] Can't compile client that retrieves a struct whichcontains a sequence

Tom O'Reilly oreilly at mbari.org
Thu May 1 12:45:23 BST 2008


> So you don't actually construct a Message_out instance explicitly.  Basically you want to pass a reference to a 
> pointer, so that the function can point your pointer at the returned message:
>
>
>    SequenceTestIF::Message *msgptr;
>    seqTest->getMessage(msgptr);
>    // now you can use msgptr->body
>    seqTest->setMessage(*msgptr);
>    delete msgptr;

OK, but I'm still a bit confused. What does the server implementation code do with the passed-in msgptr, which is null (it IS null to start with, right?)  Is it something like this:

  Server code:

   class SequenceTestServer {

     void getMessage(SequenceTestIF::Message *msg() {
        msg = &_message;
        return;       // Server encounters seg-fault after return statement.
     }

     // Define a Message member
     SequenceTestIF::Message _message;
   };



I tried something like this, but the server gets a segmentation fault after returning from getMessage().

Many thanks,
Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20080501/d2ff38b2/attachment.htm


More information about the omniORB-list mailing list