<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16608" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><BR><FONT face=Arial size=2>> So you don't actually construct a
Message_out instance explicitly. Basically you want to pass a reference to
a </FONT></DIV>
<DIV><FONT face=Arial size=2>> pointer, so that the function can point your
pointer at the returned message:</FONT></DIV>
<DIV><FONT face=Arial size=2>><BR>><BR>>
SequenceTestIF::Message *msgptr;<BR>>
seqTest->getMessage(msgptr);<BR>> // now you can use
msgptr->body<BR>>
seqTest->setMessage(*msgptr);<BR>> delete
msgptr;<BR><BR>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:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2> Server code:</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2> class SequenceTestServer
{</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2> void
getMessage(SequenceTestIF::Message *msg() {</FONT></DIV>
<DIV><FONT face="Courier New" size=2>
msg = &_message;</FONT></DIV>
<DIV><FONT face="Courier New" size=2>
return; <FONT color=#ff0000>// Server
encounters seg-fault after return statement.</FONT></FONT></DIV>
<DIV><FONT face="Courier New" size=2> }</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2> // Define a
Message member</FONT></DIV>
<DIV><FONT face="Courier New" size=2>
SequenceTestIF::Message _message;</FONT></DIV>
<DIV><FONT face="Courier New" size=2> };</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I tried something like this, but the server gets a
segmentation fault after returning from getMessage().</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Many thanks,</FONT></DIV>
<DIV><FONT face=Arial size=2>Tom</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV></BODY></HTML>