Difference between revisions of "Zh/Documentation/DevGuide/FirstSteps/Struct"

From Apache OpenOffice Wiki
Jump to: navigation, search
(New page: {{Documentation/DevGuide/FirstStepsTOC/Zh |FirstSteps2b=block |ShowPrevNext=block |PrevPage=Zh/Documentation/DevGuide/FirstSteps/Common Types |NextPage=Zh/Documentation/DevGuide/FirstSteps...)
 
m
Line 37: Line 37:
  
  
[[Category:中文]]
+
 
[[Category:文档]]
+
[[Category:文档/开发者指南/准备工作]]
[[Category:开发者指南]]
+
[[Category:准备工作]]
+

Revision as of 04:05, 11 June 2008


OpenOffice.org 中的结构用于创建其他 UNO 类型的组合。这些结构与仅包括公共成员变量的 C 结构或 Java 类相对应。

虽然结构不封装数据,但更易于作为整体传输,而不用来回封送 get()set() 调用。这对于远程 通信尤为有利。

可以通过 .(点)运算符获得对结构成员的访问权限,如下所示

  aProperty.Name = "ReadOnly";


在 Java、C++ 和 OpenOffice.org Basic 中,关键字 new 用于实例化结构。在 OLE 自动化中,使用 com.sun.star.reflection.CoreReflection 来获取 UNO 结构。请勿使用服务管理器创建结构。


  //In Java:
  com.sun.star.beans.PropertyValue aProperty = 
                  new com.sun.star.beans.PropertyValue();
  'In StarBasic
  Dim aProperty as new com.sun.star.beans.PropertyValue
Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages