[omniORB] Passing a Sequence from Python to C++

Gideon Guillen gideong at gmail.com
Mon Feb 18 19:36:39 GMT 2008


On 2/18/08, EntonH <entonh at gmx.de> wrote:
> can't someone give me an advice how to do it? :o(
> I still get the BAD_PARAM WronPythonType error... :o(
[snipped]
> typedef sequence param ParSeq;
> ....
> list_all =  []
> list_all.append (idlfile.param("1",CORBA.Any(CORBA._tc_any,list1)))
> list_all.append (idlfile.param("2",CORBA.Any(CORBA._tc_any,list2)))

You can only use the primitive types and types that were defined on
your IDL on the "any" type.

Try using the following instead:
   list_all = []
   list_all.append (idlfile.param("1",CORBA.Any(CORBA.TypeCode(ParSeq),list1)))
   list_all.append (idlfile.param("2",CORBA.Any(CORBA.TypeCode(ParSeq),list2)))
   ...
   obj.init(CORBA.Any((CORBA.TypeCode(ParSeq),list_all)))

-- 
Gideon N. Guillen
gideong at gmail.com



More information about the omniORB-list mailing list