» «

RSS订阅


    抓虾    pageflakes
    Rojo    google reader
    netvibes    my yahoo
    newsgator    blogdtnes
    鲜果    哪吒
    有道

UNO让MonoDevelop开发OpenOffice应用

来源: LUPA开源社区
发布时间: 2008-06-27 09:43 作者: Jonathan Allen 译者 朱永 来源: infoq 版权申明

字体: | 上一篇 下一篇 | 打印


文章来源于http://www.lupaworld.com
  微软Office开发人员能够通过COM自动化来很好地控制Office中的任何东西,对此他们已经夸耀很久了。由于现存大量由VBA编写的从简单到复杂的应用程序,很多公司甚至都不会考虑去尝试一下OpenOffice的开发。

  但不被很多人所知的是,OpenOffice开发人员现在也可以露几手了。OpenOffice开发的基础是UNO组件技术。类似COM,它被设计用于进程内和跨平台开发。它甚至还有一些超过COM的优点。例如,在新API中为粘结代码提供了异常处理和约定的支持。

  和COM一样,UNO支持广泛的编程语言,如C++、Java、Delphi、Perl,甚至.NET和Mono。虽然它移植到Mono已经很久,但进行设置通常需要花费太多的精力。

  最近Michael Hutchinson为MonoDevelop添加了开发OpenOffice的支持。只需简单地使用MonoDevelop中的插件管理器(Add-in manager)来下载OpenOffice自动化示例(Automation Samples),就可以获得需要的模板。Miguel de Icaza发的一个帖子包含了详细的介绍和一些截图。
 

 
Activate the Add-in Manager

 
Select Templates.


 
Select the OpenOffice Automation Samples

  Complete the installation for the Mono.Addin, once you are done, create a new Solution:


 
  You can skip this step, and get back here later, but you might want to select "Unix integration":

 

  Take advantage of code-completion:


 
  This is what the default sample looks like, you can use this as a foundation for your program. Since this is a COM-based API, it is not an API that is easy to discover with code-completion popups, so we figured it was best to ship full working samples:

 

  Build and run your application by hitting F5:

 

  Your OpenOffice solution in all of its glory, this is from the samples that we distribute as part of the templates:

 
文章来源于http://www.lupaworld.com

声明:LUPA开源社区刊登此文只为传递信息,并不表示赞同或者反对。

查看全部评论(0)我来说两句 直接向LUPA提出您的宝贵建议

-5 -3 -1 - +1 +3 +5