As always keep in mind that we’re talking about a prerelease beta. Anything can change till release. Also, special greetings to Embarcadero for giving us the permission to talk about this.
Well, as you saw, the Gestures and Touch Engine is a very welcomed addition for some of you guys, rather uninteresting for the others. But because we’re a community, we must understand that sometimes the majority prevails. And for this, we must cast our opinion in order to give an accurate snapshot of our needs. That’s why your feedback is very appreciated. But please be constructive and not punitive. Anyway you were very good so far (kudos btw).
Saying this we’ll move now to the next step of our tour through RAD Studio’s internals. We’ll talk about another feature which was created to allow a smooth transition between different OSes giving the possibility to have the ‘same’ Pascal representation of an external interface for multiple operating systems even if this interface changes. The feature is called…
Remember that in the latest post I said that Delphi uses on WinXP it’s own recognition engine whereas on Windows 7 (yep, guys, RAD Studio is Windows 7 certified – thanks to Nick for letting us know) it uses the native Win7 Touch engine. How it is done?
Windows.pas we see:
function CloseDesktop; external user32 name 'CloseDesktop'; function CloseTouchInputHandle; external user32 name 'CloseTouchInputHandle' delayed; function CloseWindow; external user32 name 'CloseWindow';
By marking delayed a function or procedure allows the application to work on operating systems which doesn’t implement that specific function by not linking that function in the code from the beginning but at the call time.
In our concrete example above, the
CloseTouchInputHandle is supported in Windows 7 only hence is delayed till is called.
By using a simple OS version check you can avoid that specific call – which will fail of course – on the systems which doesn’t support it. Something like:
if OSVersion=WINDOWS_7 then CloseTouchInputHandle else MyInternalSimplerClose;
In my opinion this new attribute will be a nice addition to everyone who has to support external libraries which evolve in time, especially for the ones who need to translate / write headers.
Do you think that this will be really useful?