Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. Article Writing
  4. Corba-orb initialisation problem

Corba-orb initialisation problem

Scheduled Pinned Locked Moved Article Writing
helpc++sysadminquestionannouncement
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hi there!! I have got quite a big problem and I wonder if you could help me out!! :)! The problem is as follows: I declared a Class in C++ called Messenger, offering some methods (Which are passed from my GUI). Its purpose is to handle this methods through to a CORBA Server, which passes it to someone else (should be some kind of video-conference....). So the constructor of the class Messenger should include the initialisation of a CORBA-Orb Client. But I absolutely don't have any idea how this works. I have looked at several examples, but they are all main programs and no seperated classes like I have. The code as it is suggested in the main programms is: main(int argc, char * argv[]) { try { // Initialize the ORB CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); // Convert the contents of the file to an object reference. CORBA::Object_var obj = orb->string_to_object("file://Messenger.ior"); if (CORBA::is_nil(obj.in())) { cerr << "Nil Messenger reference" << endl; throw 0; } // Narrow the object reference to a Messenger object reference. Messenger_var messenger = Messenger::_narrow(obj.in()); if (CORBA::is_nil(messenger.in ())) { cerr << "Not a Messenger object reference" << endl; throw 0; } // Create a message and send it to the Messenger. CORBA::String_var message = CORBA::string_dup("Howdy!"); messenger->send_message ("rick", "Test", message.inout()); // Release resources. orb->destroy(); } catch (const CORBA::Exception & ex) { cerr << "Caught a CORBA exception: " << ex << endl; return 1; } catch (...) { return 1; } cout << "Message was sent" << endl; return 0; } exception handling included. I don't see the point of the following code line: CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); What are the parameters for, given the init-method?? I hope you understand what I am asking. Sorry for my bad English :(. I'm going to learn it better :) (At least I hope so...) Thank you very much for your help! Charly

    L 1 Reply Last reply
    0
    • L Lost User

      Hi there!! I have got quite a big problem and I wonder if you could help me out!! :)! The problem is as follows: I declared a Class in C++ called Messenger, offering some methods (Which are passed from my GUI). Its purpose is to handle this methods through to a CORBA Server, which passes it to someone else (should be some kind of video-conference....). So the constructor of the class Messenger should include the initialisation of a CORBA-Orb Client. But I absolutely don't have any idea how this works. I have looked at several examples, but they are all main programs and no seperated classes like I have. The code as it is suggested in the main programms is: main(int argc, char * argv[]) { try { // Initialize the ORB CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); // Convert the contents of the file to an object reference. CORBA::Object_var obj = orb->string_to_object("file://Messenger.ior"); if (CORBA::is_nil(obj.in())) { cerr << "Nil Messenger reference" << endl; throw 0; } // Narrow the object reference to a Messenger object reference. Messenger_var messenger = Messenger::_narrow(obj.in()); if (CORBA::is_nil(messenger.in ())) { cerr << "Not a Messenger object reference" << endl; throw 0; } // Create a message and send it to the Messenger. CORBA::String_var message = CORBA::string_dup("Howdy!"); messenger->send_message ("rick", "Test", message.inout()); // Release resources. orb->destroy(); } catch (const CORBA::Exception & ex) { cerr << "Caught a CORBA exception: " << ex << endl; return 1; } catch (...) { return 1; } cout << "Message was sent" << endl; return 0; } exception handling included. I don't see the point of the following code line: CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); What are the parameters for, given the init-method?? I hope you understand what I am asking. Sorry for my bad English :(. I'm going to learn it better :) (At least I hope so...) Thank you very much for your help! Charly

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      May I recommend you try a corba related newsgroup instead, with emphasis on "newsgroup"?

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups