Dinesh Chothe wrote: > Hello, > I am developing one extension application using open > office.org2.3, open office sdk(2.3), > java 1.6,Linux(ubuntu),vc++ dll. In this application I added > menu items to menu bar and > its click event accessed selected text from doc in one > String. > 1. Now how do I pass this text to dll and get return text?
If I understand correctly, you want to implement a command callable from a menu and this command should get some text as a parameter and should return some new text, right? The good news is that the whole thing can be packed into an extension, without any need to change the OOo source code at all. First you should understand the concept of the Dispatch Framework a bit (it's explained in the Developer's Guide). In this concept you will also find how you can add new commands in extensions. The code bound to the command will be provided by an object called "protocol handler" and some "Dispatch objects" it creates. The protocal handler is initialized with the Frame object it is working on (representing the view anc controller pair it contains). From this object you can get access to the current selection. The selection allows you to retrieve the current content as well as to change it. > 2. How to integrate dll with open offices extension? > > XModel xModel = ( XModel ) UnoRuntime.queryInterface( > XModel.class, xDoc ); > XController xController = xModel.getCurrentController(); > XTextViewCursorSupplier xTVCSupplier = ( > XTextViewCursorSupplier ) > UnoRuntime.queryInterface(XTextViewCursorSupplier.class > ,xController); > XTextViewCursor xTVC = xTVCSupplier.getViewCursor(); > docText=xTVC.getString(); >>From here (doctext) I accessed selected text from doc now this text I want > to pass to dll and get back return string. As described above, you should access the ViewCursor or the SelectionSupplier via the Frame object. Best regards, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS Please don't reply to "[EMAIL PROTECTED]". I use it for the OOo lists and only rarely read other mails sent to it. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]