[omniORB] Win32 Question

Charles Martin charlesm@discreet.com
Thu, 03 Jun 1999 16:41:09 -0400


ryan.tecco wrote:
> 
> All right, here is a little snip of what I am doing. It is basically based
> on the eg2_xxxx samples.
> 
> class MyObject : public virtual _sk_MY
> {
> public:
>         MyObject();
>         virtual ~MyObject();
>         virtual char* request();
> };
> 
> BOOL CMyDlg::OnInitDialog()
> {
>  ...
>  int argc = 0;
>  CORBA::ORB_ptr orb = CORBA::ORB_init(argc, NULL, "omniORB2");
>  CORBA::BOA_ptr boa = orb->BOA_init(argc, NULL, "omniORB2_BOA");
>  my_impl = new MyObject;
>  my_impl->_obj_is_ready(boa);
>  MY_var objRef = my_impl->_this();
>  CORBA::String_var temp = orb->object_to_string(objRef);
>  std::ofstream outFile("iiop.txt", ios::out);
>  outFile << (char *)temp;
>  outFile.close();
>  boa->impl_is_ready(0, 1);
>  ...
> }
> 
> void CVoiceRecDlg::OnCancel()
> {
>         delete my_impl;
>         CDialog::OnCancel();
> }

If I recall, you should never delete a CORBA implementation object by calling
'delete' yourself. You should call 'my_impl->_dispose()' instead. This might
be what is causing your errors. But, I might be wrong since I am also
fairly new to ORBs....

- Charles

--
Charles Martin           |  Discreet inc.
charles@discreet.com     |  10, rue Duke
(514) 954-7185           |  Montreal (Quebec), Canada, H3C 2L7
http://www.discreet.com  |