[mico-devel] object member problem
gezi liu
gezi18 at yahoo.com.cn
Tue Jun 26 10:43:17 PDT 2007
Hi All:
I have some problems when i program with MICO.
the source code as follows:
///////////////////////////////////////////////////////IDLÎļþ
interface Bank
{
void Display();
}
interface Account
{
void balance();
}
/////////////////////////////////////////////////////ʵÏÖÎļþ
class Account_impl : virtual public POA_Account
{
public:
Account_impl ();
CORBA::Long balance ();
private:
CORBA::Long bal;
};
Account_impl::Account_impl ()
{
bal = 0;
}
CORBA::Long
Account_impl::balance ()
{
cout<<"account balance is calling"<<endl;
cout<<bal<<endl;
return bal;
}
class Bank_impl : virtual public POA_Bank
{
public:
void Display();
private:
Account_impl account;
};
void Bank_impl::Display()
{
cout<<"display is calling"<<endl;
cout<<account.balance();
}
I use the nameservice to get the Reference of Bank in client.
when i call it's Display(),it can't get the value of bal.
it just print: display is calling
account balance is calling
it seems that account.banlance() can't return the bal;
what's wrong with my code?
And ,is there some tools to debug mico program?
Thanks!
---------------------------------
ÇÀ×¢ÑÅ»¢Ãâ·ÑÓÊÏä3.5GÈÝÁ¿£¬20M¸½¼þ£¡
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.mico.org/pipermail/mico-devel/attachments/20070626/3461f28a/attachment.html
More information about the Mico-devel
mailing list