Happy New Year!

Delphi XE5 Update 2

If you're a user of Delphi XE5 or RAD Studio XE5, then unless you've been hiding under a rock you'll be very much aware that Update 2 was released a while back (10th December, 2013). There are quite a few changes, so it's basically one of those uninstall/reinstall cycles. On the EDN page for Update 2 you can pull down the web installer, which downloads all the required bits over the web as it sees the need to, or pull down the rather larger full Update 2 ISO CD image. When I used the CD image I found that Hotfix 1 and Hotfix 2 (also mentioned on the same page) appeared to be already applied.

However as François Piette pointed out, we now also have a Hotfix 3 for Update 2. This addresses a few missing .OBJ files (compiled versions of C source files for the JPEG support). In the absence of a README file, I decided these files belonged alongside their corresponding source files in $(BDS)\source\vcl\jpg\src (e.g. C:\Program Files (x86)\Embarcadero\RAD Studio\12.0\source\vcl\jpg\src).

Update 2 does incorporate a good number of fixes, including the really annoying one where the form designer keyboard shortcuts (various permutations of CtrlShift and the cursor keys) werenot supported by the FMX form designer (as Marco posted).

Here are links for the Release Notes and the What's New page for XE5 Update Pack 2.

One of the key features added in Update 2 was iOS development support for C++ programmers.David Intersimone made a handful of posts showing how to use this support, and they have been accompanied by and followed up with a variety of videos on the Embo YouTube channel:

  • C++Builder XE5 iOS Preview slides, video
  • What's New in C++Builder XE5 for iOS, video
  • Building your first C++Builder multi-device application, post and video
  • Using TabControls, Gestures and Actions in your C++Builder XE5 for iOS apps, post andvideo
  • Using Image Effects Filters in your C++Builder for iOS apps, post and video
  • Location enabling your C++Builder for iOS apps, post and video
  • Mobile Code Snippets: IBLite on iOS, video
  • Mobile Code Snippets: Date Picker for iOS, video
  • Mobile Code Snippets: Sharesheet & Media Library Actions, video
  • Mobile Code Snippets: Sending & Cancelling Notifications, video
  • Mobile Code Snippets: Tap & Hold Interactive Gesture, video
  • Mobile Code Snippets: Sending & Resetting Badge Numbers, video
  • Mobile Code Snippets: Pinch & Zoom Interactive Gesture, video

Another neat feature slipped in is the Mobile Preview feature, which allows you to compile and test a good chunk of your mobile functionality within a Windows preview app. It's discussed by Marco here and Sarina DuPont here and documented here.

Recent VCL enhancements

Given Embo's focus on talking lots and lots about FMX over recent years it's easy to forget that the VCL is still being enhanced. Indeed so easy that when XE5 was released, the home page made nary a mention of VCL! Anyway, in an attempt to redress the balance DavidI emitted a blog postthat talks about the benefits of VCL in Delphi XE5.

In there he mentions support for64-bit Windows, full Unicode support, FireDAC, theREST client support, VCL stylesLiveBindingsMetropolis for Windows 8-like apps, and sensor support.

Some additional posts on the REST client support are:

New product features for old product users

I discovered that Embo have made some pages that talk about new features in releases since certain commonly used old versions. For those trying to find out how much merit there might be in upgrading to the current XE5 release from an old version these pages could prove pretty useful. So we have:

Warren Postma has a post citing a variety of reasons to upgrade: Modernize your codebase: Inspiration to Ditch your Ancient Delphi Version. Do read through them.

reFind for search/replace with PCRE

Here’s a tool I didn’t notice appear in Delphi XE5. It’s a command line find/replace tool that uses Perl-compatible regular expressions (PCRE). It’s documented in the XE5 docwiki and uses a rule file to control the process of running over a bunch of source files (and form files) making specified changes.

The tool comes from FireDAC (née AnyDac) and was designed to help migrate BDE components and code over to [Any|Fire]DAC equivalents, but of course can be applied to any search/replace scenario.

Embo’s Stephen Ball posted on the topic of source migration from Delphi 5 to Delphi XE5, which is where I first bumped into the tool. I’ve since seen it referenced on posts on Mick’s Mix and Marco’s blog.

Mobile coding topics

We've had a good spate of posts on how to do various things in Delphi mobile apps.

Here are some Android-specific ones:

Here is an iOS topic:

And here are some that cover both Android and iOS:

Additionally DavidI posted a useful set of resource links that came up in his Step Up to the Multi-Device App Platform webinar so do peruse them at your leisure.

DEP & ASLR in Windows projects

While looking into reFind I bumped into a new (to me) Delphi blog from Mick Grove called Mick’s Mix. A 2011 post on there reminded me of support added to Delphi 2007 and later to supportDEP (Windows XP SP2 and later) and ASLR (Windows Vista and later).

DEP is Data Execution Prevention, which helps avoid hacked data bytes being executed. This is done in 32-bit apps using AMD’s NX (no-execute page protection) processor feature and Intel’s XD (Execute Disable Bit) processor feature.

ASLR is Address Space Layout Randomization and helps foil buffer overrun exploits by randomising the load address of DLLs. Thus ASLR is only really pertinent to DLLs or packages.

According to a post by MSDN blogger Michael Howard, and echoed by a post by Hallvard Vassbotn, Delphi 2007 added support for ASLR and DEP by the small operation of adding this after the uses clause in the project file:

{$SETPEOPTFLAGS $140}

This sets 2 flags in the DllCharacteristics field of the IMAGE_OPTIONAL_HEADER section of the PE file that your DLL will be emitted as by the linker.

IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE and IMAGE_DLLCHARACTERISTICS_NX_COMPAT are defined byMicrosoft’s MSDN documentation as having the values 0x0040 and 0x0100 respectively.

IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE is defined as: the DLL can be relocated at load time.

IMAGE_DLLCHARACTERISTICS_NX_COMPAT is defined as: the image is compatible with data execution prevention (DEP).

Neither of these constants is defined in Delphi’s Winapi.Windows.pas, but for readability you could alternatively write this below the DLL project’s uses clause:

const
  IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE = $0040;
  IMAGE_DLLCHARACTERISTICS_NX_COMPAT = $0100;

{$SETPEOPTFLAGS IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE or
                IMAGE_DLLCHARACTERISTICS_NX_COMPAT}

For ASLR in DLLs and packages you can alternatively use the undocumented {$DYNAMICBASE ON}directive (as mentioned by Michael and Hallvard), which has the same effect as setting theIMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE PE opt flag. Thus this would be a viable equivalent:

const
  IMAGE_DLLCHARACTERISTICS_NX_COMPAT = $0100;

{$SETPEOPTFLAGS IMAGE_DLLCHARACTERISTICS_NX_COMPAT}
{$DYNAMICBASE ON}

Note that in more recent product releases you can also pass these optional PE header flags using a linker switch. In the Linking section of the Project Options dialog you can pass the combined decimal flags value to the Set extra PE Header optional flags field, so $140 would need a value of 320 to be passed in.

You can see that the flags have been noted by looking at the properties of your project when running using a tool such as Process Explorer from SysInternals.

Happening in delphi world的更多相关文章

  1. TExternalThread TThread -- Delphi -- Cannot terminate an externally created thread ?

    Cannot terminate an externally created thread ? The VCL has a new TExternalThread class which derive ...

  2. delphi Drag and Drop sample 鼠标拖放操作实例

    Drag and Drop is a common operation that makes the interface user friendly: a user can drag/drop inf ...

  3. Restrict form resize -- Delphi

    http://www.delphipages.com/forum/showthread.php?t=58391 Hi, How would I restrict a form from being r ...

  4. 学习笔记:7z在delphi的应用

    最近做个发邮件的功能,需要将日志文件通过邮件发送回来用于分析,但是日志文件可能会超级大,测算下来一天可能会有800M的大小.所以压缩是不可避免了,delphi中的默认压缩算法整了半天不太好使,就看了看 ...

  5. delphi连接sql存储过程

    针对返回结果为参数的 一. 先建立自己的存储过程 ALTER PROCEDURE [dbo].[REName] ) AS BEGIN select ROW_NUMBER() over(order by ...

  6. delphi 2010与delphi XE破解版的冲突

    在系统中同时安装了Dephi 2010LITE版与Delphi XE lite后,总是会有一个有问题 是因为两者都是读取C:\ProgramData\Embarcadero目录下的license文件, ...

  7. [Delphi] Delphi版本号对照

    VER300    Delphi Seattle / C++Builder Seattle    23    230    (Delphi:Win32/Win64/OSX/iOS32/iOS64/An ...

  8. delphi tidhttp 超时设置无效的解决方法

    现在delphi都发布到xe8了,tidhttp还有缺陷,那就是超时设置在没有网络或者连不上服务器的时候是无效的,不管你设置为多少都要10-20秒.connectTimeout和readTimeout ...

  9. Delphi Code Editor 之 编辑器选项

    Delphi Code Editor 之 编辑器选项 可从Code Editor的右键菜单中选择“Properties”菜单项来查看编辑器选项.也可以从主菜单[Tools | Editor Optio ...

随机推荐

  1. xlrd,xlwt操作Excel实例

    把有合并单元格的信息读取出来,输出所在层数与位置 我要操作的Excel是这样的 要的到的是这样的效果 # -*- coding: utf-8 -*- import xlrd import xlwt r ...

  2. 用Tchromium替代webbrowser提交网页表单有关问题

    用Tchromium替代webbrowser提交网页表单有关问题   提交表单时,使用js脚本,然后用 chrm.browser.Frame['ff'].ExecuteJavaScript 提交就可以 ...

  3. 144. Binary Tree Preorder Traversal (二叉树前序遍历)

    Given a binary tree, return the preorder traversal of its nodes' values. For example:Given binary tr ...

  4. NGUI 3.50 UIButton使用

    在NGUI,3.X的版本中,取消了创建UIbutton这个选项,所以我们可以创建uisprite.uilabel等,然后在上面附加uibutton脚本,达到目的,具体步骤 1:在界面上键好2D或3D ...

  5. github Git-fork-别人的项目后更新代码的方法

     用github还处于菜的阶段,遇到问题简单记录.   举个例子,需要 fork 这个项目 https://github.com/tarobjtu/WebFundamentals.git 点击 for ...

  6. Linux常用命令--文件(夹)查找之find命令

    Linux系统用得越久,就会发现这真的是一个很优秀的系统,各种方便各种实用各种高效率. 晚饭前写一下find命令的笔记. 其实这篇笔记,也是看到一篇外文博客,写得不错,自己拿来练一练,然后才顺便写篇笔 ...

  7. AMD C1E SUPPORT

    •C1E是一种电源管理状态,它可以让处理器节能不限于处理器内核.在CIE状态,可以通过降低内存时钟速度.关闭HT技术,来降低处理器能耗.这种新功能对于12核的处理器极其重要,因为这种处理器在设计上既增 ...

  8. 通过Collections将集合转换为线程安全类集合

    通过Collections将集合转换为线程安全类集合 List集合: List<String> list=new ArrayList<String>();list.add(&q ...

  9. Java解析XML的四种方法详解 - 转载

    XML现在已经成为一种通用的数据交换格式,平台的无关性使得很多场合都需要用到XML.本文将详细介绍用Java解析XML的四种方法 在做一般的XML数据交换过程中,我更乐意传递XML字符串,而不是格式化 ...

  10. Hibernate -- 一对一映射

    一对一关联指两个表之间的记录是一一对应的关系.分为两种:外键关联和主键关联. (1)外键关联 比如一家公司(Company)和它所在的地址(Address).在业务逻辑中要求一家公司只有唯一的地址,一 ...