[Ace-users] [ace-users] Problems with _out paramter

Douglas C. Schmidt schmidt at dre.vanderbilt.edu
Tue Nov 13 13:22:56 CST 2007


Hi,

To ensure that we have proper version/platform/compiler information,
please make sure you fill out the appropriate problem report form
(PRF), which is in

$ACE_ROOT/PROBLEM-REPORT-FORM
$TAO_ROOT/PROBLEM-REPORT-FORM

or in

$ACE_ROOT/BUG-REPORT-FORM
$TAO_ROOT/BUG-REPORT-FORM

in older versions of ACE+TAO.  Make sure to include this information
when asking any questions about ACE+TAO since otherwise we have to
"guess" what version/platform/compiler/options you've using, which is
very error-prone and slows down our responsiveness.  If you don't use
the PRF, therefore, it is less likely that someone from the core
ACE+TAO developer team will be able to answer your question.
Naturally, we encourage and appreciate other members of the ACE+TAO
user community who can respond to questions that they have the answers
to.

>i have following problem:
>Transmitting a struct:
>struct MyStruct
>{
>CORBA::UShortSeq val1;
>CORBA::UShortSeq val2;
>};
>
>This is defined in my IDL-file
>
>To transmitt i have a method

What do you mean by MyStruct_out?  Don't you mean

getData (out MyStruct mS);

>getData(MyStruct_out mS)
>
>On client side i create a new one

Don't allocate mSC in the client application - this is done for you by
the stub.

>MyStruct_var mSC = new MyStruct();
>and call:
>getData(mSC);
>
>On Sever side:
>getData(MyStruct_out mS){
>         MyStruct_var mSS = new MyStruct();
>          //..set the length, fill the sequences
>         mS = mSS.out();
>}
>
>So this dont work, (and i have probelms understanding the memoy
>management too)
>
>So how can i transmitt and copy the structure from server side to
>client side?

Please take a look at how to do this in the book "CORBA Explained
Simply," which you can download from

http://www.ciaranmchale.com/download/corba-explained-simply.pdf

Thanks,

Doug
-- 
Dr. Douglas C. Schmidt                       Professor and Associate Chair
Electrical Engineering and Computer Science  TEL: (615) 343-8197
Vanderbilt University                        WEB: www.dre.vanderbilt.edu/~schmidt
Nashville, TN 37203                          NET: d.schmidt at vanderbilt.edu



More information about the Ace-users mailing list