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

EntonH entonh at gmx.de
Sun Feb 17 23:51:42 GMT 2008


Hello,

can't someone give me an advice how to do it? :o(
I still get the BAD_PARAM WronPythonType error... :o(

The funny thing about this error is the following:

When I'm passing a list of simple datatypes, the passing works - so I get an
message from a C++-function in the dll-File.

But when I'm trying to pass a list of structures I get the WrongPythonType
error.

Can someone help me out?

Greetings, EntonH



EntonH wrote:
> 
> Hello,
> 
> thanks for your reply.
> 
> I modified my idl-file like this:
> struct param
> {
> 	string value1;
> 	any value2;
> };
> 	
> typedef sequence param ParSeq;
> 
> any init(in ParSeq par_list);
> 
> So you think this should work?
> 
> list1 = []
> list1.append(
> idlfile.param("Character",CORBA.Any(CORBA.TC_string,"good")))
> list1.append( idlfile.param("Age",CORBA.Any(CORBA._tc_long,long(24))))
> 
> list2 = []
> list2.append( idlfile.param("Character",CORBA.Any(CORBA.TC_string,"bad")))
> list2.append( idlfile.param("Age",CORBA.Any(CORBA._tc_long,long(27))))
> 
> 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)))
> 
> obj.init(list_all)
> 
> How should i modify my C++-function to accept this "par_list"?
> 
> Greetings,
> EntonH
> 





-- 
View this message in context: http://www.nabble.com/Passing-a-Sequence-from-Python-to-C%2B%2B-tp15495850p15540282.html
Sent from the OmniORB - User mailing list archive at Nabble.com.




More information about the omniORB-list mailing list