[omniORB] sequence problem / beginner
konstantin.ermakov@bnpparibas.com
konstantin.ermakov@bnpparibas.com
Wed, 4 Apr 2001 14:12:50 +0200
--0__=7SnLeGGNDxsnxHZD7il2OChRW1D3Yaw6ILhoC25rolMtgGOpYKs4rdUi
Content-type: text/plain; charset=us-ascii
Content-Disposition: inline
Hello, again.
Being more specific :
===========================
the server side is :
- jumboExt.cpp
structure* jumboExt :: iXSGetData() {
tmp->length( 100 );
for( int i=0; i < 100; i++ ) {
tmp[i] = i;
};
tmp = &temp;
// return tmp._retn();
return tmp.out();
};
// note : temp and tmp were declared in the class jumboExt ( no specific
initialization );
-------------------------------
the client side is :
......
try {
................................................
structure *data;
data = handler->iXSGetData();
} catch ( CORBA :: Exception & ) {
cout << "Exception"; // This exception was thrown, I also tried to
use structure_var data. It doesn't seems to work.
};
-------------------------------------------
Internet
vonWedel@lfpt.rwth-aachen.de on 04.04.2001 14:05
To : Konstantin Ermakov, omniorb-list
cc :
bcc :
Subject: Re: [omniORB] sequence problem / beginner
Salut,
> the server side is :
>
> - jumboExt.cpp
>
> structure* jumboExt :: iXSGetData() {
>
> tmp->length( 100 );
> for( int i=0; i < 100; i++ ) {
> tmp[i] = i;
> };
>
> tmp = &temp;
> // return tmp._retn();
> return tmp.out();
> };
You neither define tmp nor temp so its difficult to spot where the
actual problem
is. You should be able to do however:
> structure* jumboExt :: iXSGetData() {
>
structure_var tmp = new structure();
> tmp->length( 100 );
> for( int i=0; i < 100; i++ ) {
> tmp[i] = i;
> };
>
return tmp._retn();
> };
> structure *data;
To be CORBA-compliant you'd rather write
structure_var data;
> data = handler->iXSGetData();
>
> } catch ( CORBA :: Exception & ) {
>
> cout << "Exception"; // This exception was thrown
>
> };
Probably due to some memory management problem in the server
because the sequence wasn't allocated properly. The book on
'Advanced CORBA programming with C++' by Henning/Vinoskit has
a good explaination of the memory management issues when using CORBA.
Lars
___________________________________________________________
This message and any attachments (the "message") are intended solely for
the addressees and are confidential. If you receive this message in error,
please delete it and immediately notify the sender.
Any use not in accord with its purpose, any dissemination or disclosure,
either whole or partial, is prohibited except formal approval.
The internet can not guarantee the integrity of this message. BNP PARIBAS
(and its subsidiaries) shall (will) not therefore be liable for the message
if modified.
--------------------------------------------------
Ce message et toutes les pieces jointes (ci-apres le "message") sont
etablis a l'intention exclusive de ses destinataires et sint confidentiels.
Si vous recevez ce message par erreur, merci de le detruire et d'en avertir
immediatement l'expediteur.
Toute utilisation de ce message non conforme a sa destination, toute
diffusion ou toute publication, totale ou partielle, est interdite, sauf
autorisation expresse.
L'internet ne permettant pas d'assurer l'integrite de ce message, BNP
PARIBAS (et ses filiales) decline(nt) toute responsabilite au titre de ce
message, dans l'hypothese ou il aurait ete modifie.
___________________________________________________________
--0__=7SnLeGGNDxsnxHZD7il2OChRW1D3Yaw6ILhoC25rolMtgGOpYKs4rdUi
Content-type: application/octet-stream;
name="vonWedel.vcf"
Content-Disposition: attachment; filename="vonWedel.vcf"
Content-transfer-encoding: base64
YmVnaW46dmNhcmQgDQpuOnZvbiBXZWRlbDtMYXJzDQp0ZWw7Y2VsbDorKzQ5IDE3MiAyMDQzNDEy
DQp0ZWw7ZmF4OisrNDkgMjQxIDg4ODgzMjYNCnRlbDt3b3JrOisrNDkgMjQxIDgwNTI0MA0KeC1t
b3ppbGxhLWh0bWw6VFJVRQ0KdXJsOmh0dHA6Ly93d3cubGZwdC5yd3RoLWFhY2hlbi5kZS9TdGFm
Zi92b253ZWRlbC5odG1sDQpvcmc6UldUSCBBYWNoZW47TGVocnN0dWhsIGZ1ZXIgUHJvemVzc3Rl
Y2huaWsNCmFkcjo7O1R1cm1zdHJhc3NlIDQ2OzUyMDU2IEFhY2hlbjs7Ow0KdmVyc2lvbjoyLjEN
CmVtYWlsO2ludGVybmV0OnZvbldlZGVsQGxmcHQucnd0aC1hYWNoZW4uZGUNCmVuZDp2Y2FyZA0K
DQo=
--0__=7SnLeGGNDxsnxHZD7il2OChRW1D3Yaw6ILhoC25rolMtgGOpYKs4rdUi--