Archive

Posts Tagged ‘Fix’

OpenSSL v0.9.8m for Indy

March 9th, 2010

Hi,

I just prepared and published an updated precompiled version of the OpenSSL libraries. As always they are available on the official Indy Mirror, the Fulgan Mirror.

Direct Link: openssl-0.9.8m-i386-win32.zip

You’ll find a ReadMe, License Information and File Hashes inside the zip archive. This version is including important bug and security fixes, using it is strongly recommended.

Regards,
Arvid

Arvid Delphi, Indy , , , , ,

OpenSSL v0.9.8l for Indy

November 9th, 2009

Hi,

I just published an updated pre-compiled version of the OpenSSL libraries. They are available at the Fulgan Mirror.

Direct Link: openssl-0.9.8l-i386-win32.zip

You’ll find the ReadMe, License Information and File Hashes inside the zip.

This release takes care of the discovered TLS re-negotiation issue (currently by disabling re-negotiation). If you run into troubles be sure to check the OpenSSL page for hints too. It is recommended to use this version immediately.

Regards,
Arvid

Arvid Delphi, Indy , , , , ,

Converting to D2009: How to keep PNGs in TImage

November 11th, 2008

Hi,

if you have been using Gustavo Daud’s PNGImage before and consider migrating existing projects to D2009 you must keep in mind that you will loose all previously assigned PNGs in your TImages.

As you all know Delphi 2009 ships with native PNG support but there are some differences. In PngImage.pas CodeGear declared

type
  TPNGObject = TPngImage deprecated 'Use TPngImage.';

So the classname for PNGs changed and the old one is marked as deprecated.

The problem: All TImage pictures are stored within the form’s .DFM file. Before inserting the binary data the IDE stores the classname (and it’s length) as a prefix to the data.

When using Gustavo’s component in D2006 it will store 0A54504E474F626A656374 which is in ASCII TPNGObject (the 1st 0A is the length of the following classname). In Delphi 2009 it stores 0954506E67496D616765 which is in ASCII TPngImage (again 09 is the length).

So when opening an existing form in D2009 the IDE searches for TPNGObject classname and as it cannot find it anymore the images are emptied.

With the help of Andreas Hausladen I came up with a solution for this:

PngClassWrapper.pas

{$IFDEF VER200}
uses
  Classes, Graphics, PngImage;

type
  TPngObject = class(TPngImage);
{$ENDIF}

implementation

{$IFDEF VER200}
initialization
  TPicture.RegisterFileFormat('PNG', 'Portable Network Graphics (Compatibility Wrapper)', TPngObject);
finalization
  TPicture.UnregisterGraphicClass(TPngObject);
{$ENDIF}

After discussing the issue Uwe Raabe yesterday published a fix inside of the PngComponents for Delphi 2009.

He used:

type
  TPNGObject = class(TPngImage);

begin
  TPicture.RegisterFileFormat('', '', TPNGObject);
end.

The empty strings will help to hide the wrapper from the FileOpen Dialog within the filter selection in the IDE.

An updated version if his port of the PngComponents for D2009 is available at CG:
PngComponents for Delphi 2009

Btw: The PngComponents Uwe published is still compatible with older Delphi Versions (tested with Delphi 2006). Only the PngImage Gustavo previously released on SourceForge is not available anymore as the license has been revoked as D2009 now ships with an enhanced version of it.

Arvid Delphi , ,

PngImageList Fix for DEP and Update for D2009

October 26th, 2008

Hi,

probably you already encountered the problem that your Delphi IDE crashes instantly when using the TPngImageList Thany made available years ago. This happens if you use the TPngImageList Designtime Package under systems with activated Data Execution Prevention (DEP).

Despite the fact that this problem existed for some years now Christian of the JEDI Windows API Team was the first to write about it in his blog recently.

Mitja P. added a comment which provides the source and a solution for the bug:

There is a function PatchPtr used in PngComponents unit PngImageList that needs a change of VirtualProtect to PAGE_EXECUTE_READWRITE instead of only PAGE_READWRITE if I remember correctly. I am also not sure if I reported this to the author at the time I was playing around with this components or not.

I’ve verified that this fix solves the issue for Delphi 2006 up to Delphi 2009. Thank you Mitja!

Additionally there is an updated version of the TPngImageList (created by Uwe Raabe) available at the CodeGear Repository:

PngComponents for Delphi 2009

As Delphi 2009 only integrates the PNG support into native ImageLists this updated component allows for using your already existing PngImageLists from projects prior to Delphi 2009 without any change to the images!

Please be aware that this version needs the mentioned fix as well, so update the source before installing the package.

Arvid Delphi , , ,

Fix: Indy Mail Attachment Filenames lost in D2009

October 2nd, 2008

Hi,

probably you already discovered a bug in Indy & D2009 that when sending E-Mails with attachments you will loose the attachment filenames.

This is related to a small bug in the Indy Version shipped with the initial release of Delphi 2009. It has already been fixed in the Indy SVN.

See the QualityCentral report for it: http://qc.codegear.com/wc/qcmain.aspx?d=66867

Bug Report Background:
Without the line break fix (see below) the attachment filename is printed in the same line as “Content-Disposition” and so some mail clients ignore the filename. Without it the file will have random names regarding to the used client.

If you do not want to update the whole Indy version shipped with D2009 you can fix the bug on your own:

1) Copy the VCL source file for IdMessageClient.pas from your D2009 directory:
C:\Program Files\CodeGear\RAD Studio\6.0\source\Indy\Indy10\Protocols\IdMessageClient.pas
to your project’s directory
2) Edit the IdMesageClient.pas and change the lines given below:

procedure TIdMessageClient.SendBody(AMsg: TIdMessage):
begin
...
  if LFileName <> '' then begin
    IOHandler.WriteLn(';'); // inserted for QC 66867, between original line 1214/1215
    IOHandler.Write('        name="' + LFileName + '"'); {do not localize}
  end;
  IOHandler.WriteLn;
  IOHandler.WriteLn('Content-Transfer-Encoding: ' + LAttachment.ContentTransfer); {do not localize}
  // next line fixed for QC 66867, changed IOHandler.Write<strong>Ln</strong> to IOHandler.Write
  IOHandler.Write('Content-Disposition: ' + LAttachment.ContentDisposition); {do not localize}
  if LFileName <> '' then begin
    IOHandler.WriteLn(';'); // inserted QC 66867, line 1220/1221
    IOHandler.Write('        filename="' + LFileName + '"'); {do not localize}
  end;
...
end;

3) Save and do a full-rebuild on your project
4) Verify that IdMessageClient.dcu has been created in your project’s directory

You can also replace the existing files in the Delphi 2009 source
directory at:

C:\Program Files\CodeGear\RAD Studio\6.0\source\Indy\Indy10\Protocols\IdMessageClient.pas

If you are doing the latter, be sure to replace the DCUs at:

1) C:\Program Files\CodeGear\RAD Studio\6.0\lib\Indy10\IdMessageClient.dcu
2) C:\Program Files\CodeGear\RAD Studio\6.0\lib\debug\Indy10\IdMessageClient.dcu

You may create the needed DCUs with the earlier mentioned steps, one
time without and a second time with enabled “Build Debug DCU” option.

Arvid Delphi, Indy ,