Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Unzip routine AV error in XE5


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Jun 2, 2014 9:02 AM Last Post By: Wayne Loeppky
Wayne Loeppky

Posts: 52
Registered: 7/4/02
Unzip routine AV error in XE5  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 30, 2014 10:33 AM
Porting a routine to unzip a file from XE5 from XE, worked in XE but no longer works in XE5. Get an AV error when I try to pull the Items from LSrcFldr. When debugging I can see that the namespace command just returns $00000000 instead of a real address. Wondering if this is a Unicode issue. Tried changing all string variables to ansistring but that made no difference, still failed.

function TVersionUpgradeFormMain.UnzipFiles(AZipFile: string; ATargetFolder: string; AFilter: string): boolean;
var
LShellObj: olevariant;
LSrcFldr: olevariant;
LDestFldr: olevariant;
LShellFldrItems: olevariant;
begin
if FileExists(AZipFile) then
begin
LShellObj := CreateOleObject('Shell.Application');

LSrcFldr := LShellObj.NameSpace(AZipFile);
LDestFldr := LShellObj.NameSpace(ATargetFolder);

LShellFldrItems := LSrcFldr.Items;
if (AFilter <> '') then
LShellFldrItems.Filter(SHCONTF_INCLUDEHIDDEN or SHCONTF_NONFOLDERS or SHCONTF_FOLDERS, AFilter);

LDestFldr.CopyHere(LShellFldrItems, SHCONTCH_NOPROGRESSBOX or SHCONTCH_RESPONDYESTOALL);
end;
end;

Wayne
Wayne Loeppky

Posts: 52
Registered: 7/4/02
Re: Unzip routine AV error in XE5  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 2, 2014 9:02 AM   in response to: Wayne Loeppky in response to: Wayne Loeppky
Wayne Loeppky wrote:

Resolved this issue by switching to use the built in TZipFile class, and using ExtractZipFile method.

Wayne
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02