王彬 wrote:
> Hi:
> 
> I am a developer and I meet with a problem in uno,so I turn to you for help.
> 
> The sourcecode version is : 680_m120
> I wrote a new component but it didn't work.
> I hope the new component can be called from a different process through a 
> socket connection.
> (But it can only be called successfully on localhost)
> 
> My work takes the following steps :
> 
>   1.Write the specification for the new component:
> 
>     module com {  module sun {  module star {  module task {
>       published interface XProcessMSG : com::sun::star::uno::XInterface
>       {
>         [oneway] void process( [in] string msg );
>       };
>     }; }; }; };

Why did you publish your new interface directly? You should first
implement it, test it and maybe discuss it before you publish the new
interface.
With the improvements in UNO you don't need explicitly inherit from
XInterface, it's obsolete.

> 
>     module com { module sun { module star { module task {
>       published service ProcessMSG
>       {
>         interface com::sun::star::task::XProcessMSG;
>         interface com::sun::star::lang::XInitialization;
>       };
>     }; }; }; };
Why you don't have created a new style service and why again have you
already published your servie?

> 
>   2.Build project offapi (Compile the idl file);
Why have you integrated your new types in offapi. Wasn't your initial
intention to create an extension for the office in form of an ew UNO
component.
Have you thought about the possibility to build your extension with the SDK?

> 
>   3.Build project offuh  (Generate source code);
> 
>   4.Implement core interfaces and my own interfaces (Located in project sfx2):
> 
Why you don't use the component implmentationhelper? See the SDK samples.

>     sfx2/inc/communication.hxx
>     ...................
>     ...................
>     // Core interfaces
>     virtual Any  SAL_CALL queryInterface( const Type& aType )throw( 
> RuntimeException );
>     virtual void SAL_CALL acquire() throw();
>     virtual void SAL_CALL release() throw();
> 
>     virtual Sequence< Type >     SAL_CALL getTypes() throw( RuntimeException 
> );
>     virtual Sequence< sal_Int8 > SAL_CALL getImplementationId() throw( 
> RuntimeException );
> 
>     virtual OUString SAL_CALL getImplementationName() throw( RuntimeException 
> );
>     virtual sal_Bool SAL_CALL supportsService( const OUString& serviceName ) 
> throw( RuntimeException );
>     virtual Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( 
> RuntimeException );
> 
>     static OUString SAL_CALL impl_getStaticImplementationName();
>     static Sequence< OUString > SAL_CALL 
> impl_getStaticSupportedServiceNames();
>     static Reference< XSingleServiceFactory > SAL_CALL impl_createFactory( 
> Reference< XMultiServiceFactory > xServiceManager );
> 
>     // My own interface
>     virtual void SAL_CALL process( const OUString& msg ) throw( 
> RuntimeException );
>     ...................
>     ...................
> 
>   5.Add registration info in "sfx2/source/appl/appuno.cxx"  ;
> 
>   6.Build project sfx2;
It would be better and easier if you would have implemented your
component in a separate library. See the SDK samples.

> 
>   7.Merge the binary type descriptions into "services.rdb" and "types.rdb"  .
Would be obsolete with the new package mechanism and a well formed UNO
package.
> 
> 
> I also tried to rebuilding the hole project,and then reinstall the openoffice.
> And I found the rdb files("services.rdb" and "types.rdb") contain the right 
> binary type descriptions.
> 

Independent of all other comments can you instantiate your new component
in your new built office?
For example you can check it in Basic with:
o = createUnoService("com.sun.star.task.ProcessMSG")
msgbox o.dbg_supportedinterfaces

If this works you probably have a problem with the socket connection.
Can you establish a working connection and can you use other services
remotely?
If yes, you should check if your new type info is also available on the
client side.
Please give some more information.

Juergen



> 
> 
>                                                               Sincerely 
> yours,WangBin
>                                                               2005-10-25
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to