0 Replies Latest reply on Mar 30, 2004 6:08 AM by 418028

    OO4O with ATL Interface.


      I am writting a ATL Dll having interface and methods. I am trying to return _IOraDatabasePtr object to VB Client object OraDatbase.

      Please, find following code.

      Please, tell this is not possible to return _IOraDatabasePtr through ATL Interface.

      Is there any other method to return interface. I am able to return ADO _Recordset interface properly in another project.

      Vikas Mishra

      STDMETHODIMP CGetOO4OConn::GetOO4oConn(_IOraDatabasePtr *m_odb)
           // TODO: Add your implementation code here

           HRESULT hr = S_OK;
           CoInitialize (NULL);

           IOraSessionPtr mpOraSession= NULL;
           m_odb= NULL;

           hr = m_pOraSession.CreateInstance(CLSID_OraServerClass ,0, CLSCTX_INPROC_SERVER);

           if( SUCCEEDED( hr ) )
      hr = m_pOraSession->CreateDatabasePool (1,10,100,_bstr_t("xyz"), bstrt("xyz/xyz"), 0);
      m_odb = m_pOraSession->get_GetDatabaseFromPool (10);
           CoUninitialize ();

           return hr;