[omniORB] How can I handle sequence type in IDL?

Stefan Naewe stefan.naewe at atlas-elektronik.com
Fri Oct 5 10:08:40 BST 2007


On 10/5/2007 2:28 AM, janarbek wrote:
> *Dear all, *
> *I have follwoing interface. *
> *typedef sequence<short> seqShort;*
>  
> interface shortSeqTestServer {
>   void setSize(inout short size);
>   void acceptType(inout seqShort value);
>   seqShort returnType();
> };
>  
> *In my C++ code, I have*
>  
> seqShort_var testPattern;
>   
> m_dSize =5;
> testPattern = new seqShort[m_dSize];

Is this a typo or do you really want to create an array of size m_dSize
of seqShort's ?
I guess you want to do:

seqShort_var testPattern = new seqShort(m_dSize);
testPattern.length(m_dSize);

>    for (int i = 0; i < m_dSize; i++)
>     testPattern[i] = (short) 1;
>  
> *Now I am doing*
> objsshortSeqTestServer-> acceptType(testPattern ); 
> *But it just gives BAD CORBA PARAM error. I didn't find what is wrong.
> Someone has any advice? *


Regards,
     Stefan
-- 
----------------------------------------------------------------------
Dipl.-Inform. Stefan Naewe                       ATLAS Elektronik GmbH
                                                         Dept.: NUS T4
phone: +49-(0)421-457-1378                Sebaldsbruecker Heerstr. 235
fax:   +49-(0)421-457-3913                                28305 Bremen



More information about the omniORB-list mailing list