Discussion:
[omniORB] problems with Matrix
Tomás Dias Almeida
2006-11-17 22:40:29 UTC
Permalink
Hello !
I have defined a structure Image containing a matrix. But the client doesn't
work.
There is an error message: " terminate called after throwing an instance of
'CORBA::BAD_PARAM' "
and I think the problem is the initialization of the matrix:

Image img;
img.m[0][0] = (CORBA::Octet) 6;
...
img.m[2][2] = (CORBA::Octet) 6;
img.nbl = 3;
img.nbc = 3;

---- file.idl
typedef sequence<sequence<octet> > Matrix;
struct Image{
Matrix m;
short _nbc;
short _nbl;
};

Please help me, where can i find a solution ?

[]'s

===============================
Tom?s Dias ALMEIDA
***@gmail.com
===============================
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20061117/f0bf9522/attachment.htm
Clarke Brunt
2006-11-17 23:11:11 UTC
Permalink
Post by Tomás Dias Almeida
I have defined a structure Image containing a matrix. But the client
doesn't work.
There is an error message: " terminate called after throwing an
instance of 'CORBA::BAD_PARAM' " and I think the problem is the
Image img;
img.m[0][0] = (CORBA::Octet) 6;
...
img.m[2][2] = (CORBA::Octet) 6;
img.nbl = 3;
img.nbc = 3;
---- file.idl
typedef sequence<sequence<octet> > Matrix;
struct Image{
Matrix m;
short _nbc;
short _nbl;
};
Please help me, where can i find a solution ?
You don't appear to have allocated any memory for the sequences. This could easily be wrong, as I haven't tried it, and have never used a 'sequence of sequences' myself, but I imagine you would need something like:

Image img;
img.length(2); // allocate two elements: you can now access img[0] and img[1]
img[0].length(2); // allocate length of sub-sequence
img[1].length(2); // needn't be the same length

Then fill in the elements as you were doing.

I suspect you might need to read up about the C++ binding for CORBA, as you will probably soon find other things that you won't know how to do.
--
Clarke Brunt, Principal Software Engineer, Trafficmaster


This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.
Continue reading on narkive:
Loading...