C problem



Hi,
I've a programming problem... It's all the day I'm trying to solve it:
maybe I'm too stupid.
I know this isn't a real ORBit question, but the code is "ORBit-based"
so I thought to write in this lovely mailing list.
The following code would have to output (in three different way) a
string contained in the attr_dispID sequence.
My problem is that only the first printf correctly output the string;
the second and the third one output random chars.

Where's my error??
Thanks a lot! Any tip is really important for me!
Samuele

Here's the function code:

static DispatcherList_List *
impl_DispatcherList__get_dispID(impl_POA_DispatcherList * servant,
    CORBA_Environment * ev)
{
   DispatcherList_List * retval;

   printf("Getting the dispatcher list... %c %c %c %c ",
servant->attr_dispID._buffer[0][0], servant->attr_dispID._buffer[0][1],
servant->attr_dispID._buffer[0][2], servant->attr_dispID._buffer[0][3]);

   printf("Getting the dispatcher list... %s ",
CORBA_string_dup(servant->attr_dispID._buffer[0]));
   retval= &(servant->attr_dispID);
   printf("%s\n", CORBA_string_dup(retval->_buffer[0]));

   return retval;
}

To complete my rough presentation of the problem, here's the idl
structure of my class:

interface DispatcherList
{

  typedef sequence <string> List;

  attribute List dispID;
}





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]