Discussion:
[omniORB] How can I handle sequence type in IDL?
janarbek
2007-10-05 06:28:28 UTC
Permalink
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];
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,
janar



---------------------------------
Catch up on fall's hot new shows on Yahoo! TV. Watch previews, get listings, and more!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20071004/859d0fe7/attachment.htm
Stefan Naewe
2007-10-05 13:08:57 UTC
Permalink
*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
Loading...