Hello Ariel,

> > I have written a C++ component, which works fine. But just recently I
> > noticed that
> > 
> > void SAL_CALL myComponent::initialize( const Sequence< Any >&
> > aArguments ) throw ( Exception, RuntimeException)
> > 
> > is called four times after running openoffice.org -writer before the
> > empty writer document opens.
> 
> what kind of component have you written?

I am not sure what information you need. Here is the class definition (C
++, Linux x86) and the relevant method:

class iMath : public cppu::WeakImplHelper6
<
        XDispatchProvider,
        XDispatch,
        XInitialization,
        XServiceInfo,
        XDialogEventHandler,
        XContainerWindowEventHandler
>
{
public:
// XInitialization
  virtual void SAL_CALL initialize
(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >&
aArguments)     throw (Exception, RuntimeException);
}

and its implementation:

void SAL_CALL iMath::initialize( const Sequence< Any >& aArguments )
throw ( Exception, RuntimeException)
{
    // Get the service manager for later use
    mxMCF = mxCC->getServiceManager();

    // get the frame for later use
    Reference < XFrame > xFrame;
    if (aArguments.getLength()) {
      aArguments[0] >>= xFrame;
      mxFrame = xFrame;
    }

    // Create the toolkit to have access to it later
    mxToolkit = Reference< XToolkit
>( mxMCF->createInstanceWithContext(OUString( 
>RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.Toolkit" )), mxCC), 
>UNO_QUERY_THROW );
    
    // Here comes custom initialization for the component
    <omitted>
    // And this tells me about the multiple calls:
    std::cout << "iMath::initialize called" << std::endl;
}

Is that what you were asking for?

Regards,
        Jan



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to