Hi Mikhail,
   Thank you very much for guidance! I will try in that way. Thanks!

Best regards,

Humphry Su (He Feng)
Symphony Common App and Performance, IBM China Software Development LAB,
Beijing
Tel: 86-10-82452452 Fax: 86-10-62982924
NOTES:He Feng Su/China/IBM E-mail: suhef...@cn.ibm.com


|------------>
| From:      |
|------------>
  
>-----------------------------------------------------------------------------------------------------------------------------------------------|
  |Mikhail Voytenko <mikhail.voyte...@sun.com>                                  
                                                                  |
  
>-----------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| To:        |
|------------>
  
>-----------------------------------------------------------------------------------------------------------------------------------------------|
  |dev@openoffice.org                                                           
                                                                  |
  
>-----------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Date:      |
|------------>
  
>-----------------------------------------------------------------------------------------------------------------------------------------------|
  |08/20/2009 02:01 PM                                                          
                                                                  |
  
>-----------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Subject:   |
|------------>
  
>-----------------------------------------------------------------------------------------------------------------------------------------------|
  |Re: [dev] OLE can not be activated in Windows OS after Java integration      
                                                                  |
  
>-----------------------------------------------------------------------------------------------------------------------------------------------|





Hi He Feng Su,

Please try to use "com.sun.star.awt.AsyncCallback" service to get a
callback from the office main thread. You will need an own object
implementing com::sun::star::awt::XCallback interface. This object will
be provided to the com::sun::star::awt::XRequestCallback::addCallback()
call.

Just to explain the mechanics for better understanding. When java
application calls an UNO API method through a bridge, a new thread is
created on Office side and the method is executed in this thread.
When the XRequestCallback.addCallback() is called it sends a
notification with arguments to the main office thread and returns. After
a while the main thread calls XCallback::notify(), and if this method
does a call to the office back, the call is handled in the office main
thread.

Hope that helps.

Best regards,
Mikhail.

On 08/19/09 02:43 PM, He Feng Su wrote:
> Thanks Mikhail!
>
> The error is "0x8001010E The application called an interface that was
> marshalled for a different thread ".
>
> It's true that the OLE creation and activation happen in different
> thread. I make use of "LoadComponentFromURL" UNO interface to load the
> MS office document and it
> happen in OOo non-main thread. And activation happens in OOo main
> thread. How can I make sure the loading happen in OOo main thread by UNO
> API calling on java side?
>
> Best regards,
>
> Humphry Su (He Feng)
> Symphony Common App and Performance, IBM China Software Development LAB,
> Beijing
> Tel: 86-10-82452452 Fax: 86-10-62982924
> NOTES:He Feng Su/China/IBM E-mail: suhef...@cn.ibm.com
>
> Inactive hide details for Mikhail Voytenko ---08/19/2009 03:04:48
> PM---Hi,Mikhail Voytenko ---08/19/2009 03:04:48 PM---Hi,
>
>
> From:
> Mikhail Voytenko <mikhail.voyte...@sun.com>
>
> To:
> dev@openoffice.org
>
> Date:
> 08/19/2009 03:04 PM
>
> Subject:
> Re: [dev] OLE can not be activated in Windows OS after Java integration
>
> ------------------------------------------------------------------------
>
>
>
> Hi,
>
> If the object can be activated when the document is loaded in the normal
> office, that would mean for me that a threading problem takes place. COM
> does not support multi-threading ( as well as actually OOo ), so the
> object should be activated from the same thread where it was created.
>
> So I suspect that either the object is created in OOo non-main thread or
> activated in OOo non-main thread, or both is done in two different OOo
> non-main threads.
>
> Which exactly error do you get from DoVerb() call?
>
> Best regards,
> Mikhail.
>
> On 08/19/09 03:55 AM, He Feng Su wrote:
>  > Hello all,
>  >   After I integrated OO3 into Java window, everything is OK. But I
find
>  > that the OLE object in MS Office file can not be activated in windows
OS.
>  > Per my debugging,
>  > the Windows APIs calling failed as below in
>  > "lib\embeddedobj\source\msole\olecomponent.cxx".
>  >    hr = m_pNativeImpl->m_pOleObject->DoVerb( nVerbID, NULL,
>  > m_pOleWrapClientSite, 0, NULL, NULL );
>  >
>  >  If you had any idea on that, please help. Thank you very much!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
> For additional commands, e-mail: dev-h...@openoffice.org
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org


Reply via email to