Archive for the ‘Delphi XE5’ Category
Posted by jpluimers on 2014/08/29
Thanks Asbjørn Heid for sharing this:
I made this! –
So this week I’ve been mostly trying to add some GMail integration to our app. Google now requires OAuth2 authentication when using IMAP, unless you turn off some scary-sounding security setting on your account.
While Indy‘s IMAP component supports SASL authentication, there was no XOAuth2 SASL component out of the box. Thanks to the new REST stuff in Delphi, the OAuth2 basics where there so just had to tie them together.
In case others might find it fruitful, I’ve shared my results here: https://github.com/lordcrc/IndySASLOAuth2
notes:
–jeroen
via: So this week I’ve been mostly trying to add some GMail integration to our app.….
Posted in Delphi, Delphi XE5, Delphi XE6, Delphi XE7, Development, Software Development | 1 Comment »
Posted by jpluimers on 2014/08/28
Quiz questions:
- Does the below unit test succeed or fail?
- Why?
procedure TestHResult.Test_EOleException;
var
OleException: EOleException;
IResult: LongInt; // == HResult
UResult: Cardinal; // == DWord
begin
IResult := $800A11FD;
UResult := $800A11FD;
try
OleException := EOleException.Create('message', $800A11FD, 'source', 'helpfile', -1);
raise OleException;
except
on E: EOleException do
begin
if E.ErrorCode = $800A11FD then
Exit;
Self.CheckEquals(E.ErrorCode, $800A11FD, 'E.ErrorCode should equal $800A11FD');
end; // E: EOleException
end;
end;
Read the rest of this entry »
Posted in Conference Topics, Conferences, Delphi, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Event, Software Development | 2 Comments »
Posted by jpluimers on 2014/08/27
Interesting, as I didn’t think this was possible. Thanks Oliver Funcke!
Notification when a `TFrame` becomes visible.
TMyCommonFrame = class(TFrame)
private
FOnShow: TNotifyEvent;
procedure CMShowingChanged(var M: TMessage); message CM_SHOWINGCHANGED;
public
property OnShow : TNotifyEvent read FOnShow write FOnShow;
end;
...
procedure TMyCommonFrame.CMShowingChanged(var M: TMessage);
begin
inherited;
if Showing and Assigned(FOnShow) then
FOnShow(Self);
end;
–jeroen
via Is there any way for a VCL TFrame to be notified when it is actually shown to….
Posted in Delphi, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2014/08/22
While updating a project to a more recent version of Delphi, I also updated the JEDI.INC reference.
Note that since writing Delphi – finding the VERxxx define for a particular Delphi version: use JEDI.INC, the Delphi JEDI project moved from SoureForge to GitHub.
The fun thing: JEDI.INC got updated a few months ago to support Delphi XE7 provisionally.
Given the Delphi release cycle of twice a year, the Delphi Carpathia aka XE7 rumours this summer, I presume Delphi XE7 is near because of:
By then the list of Delphi Versionen | Delphi-Treff will likely also be updaed.
I’m anxious to see if the (Dutch + English) BIG Delphi Conference organized by Barnsten and Blaise from September 11-12 in the Netherlands will be part of the launch tour.
Anyway: here is the JEDI.INC portion with defines: Read the rest of this entry »
Posted in Delphi, Delphi 1, Delphi 2, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Development, Software Development | 6 Comments »
Posted by jpluimers on 2014/08/19
Since this did not make it to DelphiFeeds yet: I’ve seen the function PaletteFromDIBColorTable in Graphics.pas go back as far at least until Delphi 2006, and references on the web as far back as Delphi 4.
So: this bug is old, but as it is a security one, make sure you patch soon.
For Delphi XE6, download 29913 BMP Buffer Overflow hotfix – Delphi, C++Builder, RAD Studio XE6.
For older Delphi versions, read this piece that was adapted from the EDN article Delphi and C++ Builder VCL Library Buffer Overflow:
For users of prior versions of Delphi and C++Builder: these steps should be followed to modify the VCL source code and add it to your application.
For each application:
- Add the modified Edit Vcl.Graphics.pas or Graphics.pas or Borland.Vcl.Graphics.pas to your project
- For C++Builder: Under Project | Options | Packages | Runtime Packages, set “Link with runtime packages” to false
- Rebuild your application
Once for the native VCL and .NET VCL:
- Note: Variable names and scoping might be slightly different depending on your product version.
- Edit Vcl.Graphics.pas or Graphics.pas or Borland.Vcl.Graphics.pas
- Locate the function PaletteFromDIBColorTable.
- Add the following code just before the line assigning a value to Pal.palNumEntries when the DIBHandle = 0
if ColorCount > 256 then
InvalidGraphic{$IFNDEF CLR}@{$ENDIF}SInvalidBitmap;;
–jeroen
via Delphi and C++ Builder VCL Library Buffer Overflow.
Posted in Delphi, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Development, Software Development | Tagged: Buffer Overflow, Delphi, Delphi versions, vcl | 5 Comments »
Posted by jpluimers on 2014/08/12
In the With Statement series:
Lars Fosdal – Code Rants
The dreaded with…
Debugging today, I found another gotcha.
In this case, both Self and DisconnectedClient has a property named ClientIdentifier.
Note the difference for the mouse-over and the evaluation.
–jeroen
Read the rest of this entry »
Posted in Appmethod, Borland Pascal, Delphi, Delphi 1, Delphi 2, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Development, Pascal, Software Development, Turbo Pascal, With statement | Leave a Comment »
Posted by jpluimers on 2014/08/04
Short answer: do not use the GlobalContainer.
Long answers are in this Spring4D thread: How is the GlobalContainer intended to be used? Are there important don’ts? – Google Groups.
Especially read this message by Stefan Glienke that shows you to setup your main program without using GlobalContainer at all.
Note that this doesn’t mean you should avoid a container at all.
Background information:
–jeroen
Posted in Delphi, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE5, Delphi XE6, Development, Software Development, Spring4D | 5 Comments »
Posted by jpluimers on 2014/07/19
Though fully justified text is most often in print, and not much in user interfaces any more, this might come in useful one day (it is based on the GDI functions TextOut and SetTextJustification):
David Millington Posted: Have you ever wanted to draw fully justified text ie, text that adheres to both the left and right sides of the destination rectangle? It’s more complicated than it seems, and there’s definitely no inbuilt support in the VCL. But here’s how to do it, including an open-source unit you can drop into your applications and use.
Drawing fully justified text to a canvas | Parnassus – Delphi Consulting & Plugins.
–jeroen
via:
Posted in Delphi, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 7, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2014/05/05
I learned something new today (thanks Vin Colgin) the Delphi Design-Time Component Name is Limited to 63 characters.
Uwe Raabe found out that this an Object Inspector thing due to this constant in DesignIntf.pas:
const
MaxIdentLength = 63;
It has been probably there since Delphi 1 and has been documented on-line since at least Delphi 2007.
I remember having had long (like 100+ character) identifiers in source code, but not in the Object Inspector.
Now I know you can’t (:
–jeroen
via: Vin Colgin – Google+ – Delphi: Design-Time Component Name Limited to 63 characters….
Posted in Delphi, Delphi 1, Delphi 2, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Development, Software Development | 4 Comments »
Posted by jpluimers on 2014/05/05
There is an interesting G+ discussion thread about generic Dictionaries in Delphi.
It covers the stock TObjectDictionary in the Generic.Collections unit, Spring4D, performance characteristics like O(1), O(log n), etc, and implementation details like fill factors and hashing algorithms.
Worth reading at Steve Maughan – Google+ – TObjectDictionary Advice Needed I’ve been using Delphi for….
Since TObjectDictionary hasn’t changed much since the introduction of generics in Delphi, this discussion is valid for at least Delphi XE and up (and probably Delphi 2010 and 2009 as well).
I’m not sure about these last ones as like Andreas Hausladen, I’m cutting back on the Delphi versions I regularly use, which for now are mainly XE6, XE3, XE and 2007).
–jeroen
Posted in Delphi, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Development, Software Development | Leave a Comment »