升级到Delphi 6 - 兼容性问题之三(完)

类别:Delphi 点击:0 评论:0 推荐:
 

 

八.             TDesignWindow 的变化

许多变化都和类TDesignWindow有关。它的声明被移到单元DesignWindows中,并且FromClosed方法被替换为DesignerClosed。以往,在FromClosed事件中可以通过访问参数Aform来访问Form。而在新的事件DesignerClosed中,我们需要访问Designer的Root属性来访问Form。

在FormClosed事件中,我们可以通过调用TDesignerSelectionList.Create 或者 TComponentList.Create来创建选择列表。而在DesignerClosed事件中作同样的事情,我们得使用IDesignerSelections接口。你可以调用CreateSelectionList函数来获得一个借口。

SelectionClosed方法的参数也和Delphi 5版本中的有所不同。

 

TDesignWindow changes

There have been a number of changes related to the class TDesignWindow. It has been moved to the DesignWindows unit, and its FormClosed method has been replaced by DesignerClosed. In the past, one could obtain access to the form within FormClosed by using the AForm parameter. In DesignerClosed, it is now necessary to use Designer's Root property to access the form.

       In FormClosed, one would create selection lists by calling TDesignerSelectionList.Create or TComponentList.Create. To create selection lists within DesignerClosed, it is necessary to use an IDesignerSelections interface. You can create one using the CreateSelectionList function.

Parameters for the SelectionClosed method are also different from what they were in Delphi 5.

       Borland wishes to thank field tester Matt Palcic for bringing these changes to our attention.

 

九.             VCL 包的变化

一些VCL相关的包已经被重新分配到其他的包里。假如你在工程中引用了vcl50.dcp,那么你需要将这个引用改为其他单元,如vcl.dcp和rtl.dcp。

 

VCL package changes

The contents of some of the VCL-related packages have been redistributed into other packages. If you made references to vcl50.dcp in your project, you will need to change those references to other units, such as vcl.dcp and rtl.dcp.

Borland wishes to thank field tester Clay Shannon for bringing this change to our attention.

 

十.             OpenGL 接口单元改到rtl.dcp

Borland OpenGL接口单元(opengl.dcu)在Delphi 5的库单元目录中是一个独立的单元。在Delphi 6中它被合并到rtl.dcp中。这可能导致某些Delphi 5的工程升级到Delphi 6时引发一些问题。

举个例子来说。在Delphi 5的工程中,可能你会将与OpenGL单元同名的单元放置在工程目录中,以覆盖系统提供的OpenGL单元。而在Delphi 6中,假如有任何组件引用了rtl.dcp,则将导致命名冲突,得更改名称才行。

 

OpenGL interface unit moved to rtl.dcp

The Borland OpenGL interface unit (opengl.dcu) was an independent unit in the Delphi 5 Lib folder. It has been incorporated into rtl.dcp in Delphi 6. This may cause some problems for Delphi 5 projects ported to Delphi 6.

       Here is an example. In a Delphi 5 project, it was possible to make a project-specific override of the OpenGL unit by placing a unit with the same name somewhere in your project path. The same method used in Delphi 6 causes a name conflict in any component that uses rtl.dcp also, and a name change is now required.

Borland wishes to thank field tester John Williams for bringing this change to our attention.

 

十一.             HTTPApp.pas 单元中的一些类型声明移动到 HTTPProd.pas单元中

HTTPApp 单元中的一部分类型被移动到了HTTPProd 单元中。他们是THTMLBgColor,THTMLAlign 和THTMLVAlign。如果你的工程中使用了这些类,那么需要将引用的单元由HTTPProd改为 HTTPApp 。

 

Types moved from HTTPApp.pas to HTTPProd.pas

Several types in the HTTPApp unit have been moved to the HTTPProd unit. They are THTMLBgColor, THTMLAlign and THTMLVAlign. If your projects use any of these units, you should change your uses statements to refer to HTTPProd instead HTTPApp.

 

十二.             Search 单元被删除,SearchBuf例程做了修改并被移动

单元Search在Delphi 6中不再保留。SearchBuf例程,用来在一个文本的缓冲区中定位子串,已经被移动到StrUtils单元中,并且调用的参数也发生了变化。最后一个参数改为一个TstringSearchOptions的对象。如果你的工程因为不能找到Search单元而无法编译,请将引用Search改为引用StrUtils单元。同时你应当检查对SearchBuf的调用是否符合新的语法。

 

Search unit removed, SearchBuf moved and changed

The unit Search no longer exists in Delphi 6. The SearchBuf routine, which locates a substring within a text buffer, has been moved to the StrUtils unit and its parameters have changed. The final parameter is now a TStringSearchOptions object. If your project won't compile because the compiler can't find the Search unit, change your uses statement to include StrUtils instead of Search. You will also want to check your SearchBuf calls to ensure that your parameters match the new syntax.

 

[文终]

本文地址:http://com.8s8s.com/it/it6075.htm