Happening in delphi world
Happy New Year!
- Delphi XE5 Update 2
- Recent VCL enhancements
- New product features for old product users
- reFind for search/replace with PCRE
- Mobile coding topics
- DEP & ASLR in Windows projects
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 Ctrl
, Shift
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 styles, LiveBindings, Metropolis for Windows 8-like apps, and sensor support.
Some additional posts on the REST client support are:
- No time to rest: Endless possibilities with REST for VCL and FM by JT
- Using FDMemTable with REST in your VCL apps by Sarina DuPont
- Riding the waves over the holidays with REST by Sarina DuPont
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:
- What RAD Studio XE5 or Delphi XE5 can offer to users of Delphi XE2, Delphi XE3 and Delphi XE4
- What RAD Studio XE5 or Delphi XE5 can offer to users of Delphi 2009, Delphi 2010 and Delphi XE
- What RAD Studio XE5 or Delphi XE5 can offer to users of Delphi 2006 and Delphi 2007
- What RAD Studio XE5 or Delphi XE5 can offer to users of Delphi 7
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:
- How to create an overflow menu by Sarina DuPont
- Installing and running Android apps from the command-line by Jim McKeeth
- How to use a broadcast receiver to auto-start an app on device boot by Danny Wind (using my broadcast receiver approach from my service app sample)
- FireMonkey, Android, Windows and PostMessage, or how to use the messaging system on Windows and Android with common code, by François Piette
- D.P.F. Delphi Android Native Controls by Babak Yaghoobi, and posted about by Chris Rolliston
Here is an iOS topic:
- D.P.F. Delphi iOS Native Controls by Babak Yaghoobi
And here are some that cover both Android and iOS:
- How to produce an Android-like Toast message across iOS and Android by Roland Kossow, which uses my Android Toast import unit
- Creating a slide-out drawer by José León
- Deploying/accessing local files on iOS and Android by DavidI
- Loading custom styles at runtime by Sarina DuPont
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的更多相关文章
- TExternalThread TThread -- Delphi -- Cannot terminate an externally created thread ?
Cannot terminate an externally created thread ? The VCL has a new TExternalThread class which derive ...
- delphi Drag and Drop sample 鼠标拖放操作实例
Drag and Drop is a common operation that makes the interface user friendly: a user can drag/drop inf ...
- Restrict form resize -- Delphi
http://www.delphipages.com/forum/showthread.php?t=58391 Hi, How would I restrict a form from being r ...
- 学习笔记:7z在delphi的应用
最近做个发邮件的功能,需要将日志文件通过邮件发送回来用于分析,但是日志文件可能会超级大,测算下来一天可能会有800M的大小.所以压缩是不可避免了,delphi中的默认压缩算法整了半天不太好使,就看了看 ...
- delphi连接sql存储过程
针对返回结果为参数的 一. 先建立自己的存储过程 ALTER PROCEDURE [dbo].[REName] ) AS BEGIN select ROW_NUMBER() over(order by ...
- delphi 2010与delphi XE破解版的冲突
在系统中同时安装了Dephi 2010LITE版与Delphi XE lite后,总是会有一个有问题 是因为两者都是读取C:\ProgramData\Embarcadero目录下的license文件, ...
- [Delphi] Delphi版本号对照
VER300 Delphi Seattle / C++Builder Seattle 23 230 (Delphi:Win32/Win64/OSX/iOS32/iOS64/An ...
- delphi tidhttp 超时设置无效的解决方法
现在delphi都发布到xe8了,tidhttp还有缺陷,那就是超时设置在没有网络或者连不上服务器的时候是无效的,不管你设置为多少都要10-20秒.connectTimeout和readTimeout ...
- Delphi Code Editor 之 编辑器选项
Delphi Code Editor 之 编辑器选项 可从Code Editor的右键菜单中选择“Properties”菜单项来查看编辑器选项.也可以从主菜单[Tools | Editor Optio ...
随机推荐
- $python虚拟化运行环境——virtualenv
介绍 virtualenv是一种虚拟化环境,可以理解为创建了一个虚拟化的pyhon运行空间,可以从新安装各种库,而与本机环境互不影响,互相隔离. 安装及使用 首先要安装包管理工具pip(pip的使用详 ...
- C# Winform DataGrid 绑定List<> Or ObservableCollection<> 类型无法自动刷新问题
当DataGrid通过绑定List<> Or ObservableCollection<> 类型数据,通过INofityPropertyChanged接口通知数据改变进行刷新无 ...
- 【JavaScript】canvas实现一个小游戏
参考: 1.image onload事件:http://www.runoob.com/jsref/event-img-onload.html(赞) 2.canvas的drawImage无法显示图像:h ...
- 文件操作工具类: 文件/目录的创建、删除、移动、复制、zip压缩与解压.
FileOperationUtils.java package com.xnl.utils; import java.io.BufferedInputStream; import java.io.Bu ...
- Java基础(1)--JDK,变量
Scanner的next()方法和nextLine()方法 1.next()一定要读取到有效字符后才可以结束输入,对输入有效字符之前遇到的空格键.Tab键或Enter键等结束符,next()方法会自动 ...
- spring整合redis配置
第一步:添加需要的jar包 <!-- redis --> <dependency> <groupId>redis.clients</groupId> & ...
- Windows 10 操作系统删除Administrator登录选项
在win10操作系统锁屏界面登录选项中突然出现了两个用户选项,一个是自己微软账户登录的用户,另一个是Administrator登录选项,每次看到好别扭,怎么去掉呢? 一.以管理员身份运行命令提示符(c ...
- Ubuntu 16 下面的文件比较工具 Meld
安装 sudo apt-get install meld 使用 很好用,很方便.支持文件比较,文件夹比较.
- Pandas基本功能
到目前为止,我们了解了三种Pandas数据结构以及如何创建它们.接下来将主要关注数据帧(DataFrame)对象,因为它在实时数据处理中非常重要,并且还讨论其他数据结构. 系列基本功能 编号 属性或方 ...
- ReflectionZ_测试_01
1.Java代码 public class TreflectionZ { public static void main(String[] args) throws Exception { Class ...