[omniORB] two interfaces and factory function

Wernke Zur Borg wernke.zur.borg at vega.de
Fri Feb 29 14:25:23 GMT 2008


> Of Ronald Andrae
> Sent: 28 February 2008 18:37
> To: omniorb-list at omniorb-support.com
> Subject: [omniORB] two interfaces and factory function
> 
> Hello,
> 
> I have a IDL with a factory interface and two other interfaces,
> 
> 
> interface User {
> //...
> };
> 
> interface Student : User {
> //...
> };
> 
> now I want to use the factory function in C++. 
> 
> 
> Student_ptr createStudent() {
>     Student_impl *newStudent = new Student_impl();
>     Student_ptr sp = newStudent->Student_impl::_this();
>     return sp;
> }
> 
> 
> The problem is that the "_this()" function want to use the 
> User class. How I can fix this problem?
> 

What problem? Can you try to describe it a bit better? What do you mean
with "use the User class" ?

Have you defined Student_impl as a subclass of User_impl?

And why don't you simply write 

Student_ptr sp = newStudent->_this();  ?

Cheers, Wernke




More information about the omniORB-list mailing list