Registered: 14 years ago
(Cross posted to phorum)
Your Currency::Convertor_var type is essentially a smart pointer to an object reference, which in the sample code you provide (it may not be complete) isn't pointing at anything. Normally Convertor_var type would be used on the client side.
On the server side you need to
(1) first create a new servant implementation,
(2) then activate it with a POA (either explicitly or implicitly), and
(3) then get the object reference (the ref variable referred to below) and bind that with a name in the naming service.
Exactly how you do all that, I'll leave as an exercise for now (hint: its in tut102).
Werner Traut (W) wrote:
> Hi Bob,
> I'm trying to register my currency object in code as in section 7.4 but
> get some weird errors:
> C:\Cos311\Currency3>client -ORBInitRef
> Binding Currency in the Naming Service ... Done.
> [1679785623 - 0x3db8c0] c:/unisa/mico/include/mico/template.h:103:
> assertion failed
> This application has requested the Runtime to terminate it in an unsual
> Please contact the application's support team for more information.
> In the tut letter there is a line of code: nc->rebind(name, ref );
> What is this ref variable.
> Here is my code
> Currency::Convertor_var converter;
> //Construct naming Service
> CosNaming::Name name;
> name.id = CORBA::string_dup("Currency"
> name.kind = CORBA::string_dup(""
> cout << "Binding Bank in the Naming Service ... " << flush;
> nc->rebind(name, converter );
> cout << "Done." << endl;