acces violation at address 004b84 in module "SecurityScreensaver.exe"

Please support our Pascal and Delphi advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2008
Posts: 17
Reputation: darkyere is an unknown quantity at this point 
Solved Threads: 0
darkyere darkyere is offline Offline
Newbie Poster

acces violation at address 004b84 in module "SecurityScreensaver.exe"

 
0
  #1
Dec 1st, 2008
Hello, i have this code who ive been using whitout any problems. and then suddenly at says acces violation at address 004b84 in module

"SecurityScreensaver.exe" when i trie to save a tstringlist to a file.

this is how the code looks

procedure TForm7.Button8Click(Sender: TObject);
var s : tstringlist;
begin
savedialog1.Title := 'Save image list to file (PS. Remember to add the extension name (etc. *.sss) to the end of the file';

// Only allow existing files to be selected
savedialog1.Options := [ofFileMustExist];

// Allow only *.bmp *.jpeg/jpg *.ico
savedialog1.Filter := 'All Supportet files|*.Txt; *.SSS|Text files|*.txt|Security Screen Saver File|*.SSS';

// Select All supportet formats
savedialog1.FilterIndex := 3;

// Display the open file dialog
if savedialog1.Execute then
begin
S := TStringList.Create;
for i := 0 to ListView1.Items.Count do
begin
S.Add(ListView1.Items[i].Caption); {This is where the error occurs}
end;
S.SaveToFile(savedialog1.FileName);
S.Free;
multipleimages := true;
multipleimagesdes := savedialog1.FileName
end
else
begin
multipleimages := false;
multipleimagesdes := 'None';
end;
end;

Any help would be appreciated,

Best Regards,
Darkyere
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: acces violation at address 004b84 in module "SecurityScreensaver.exe"

 
0
  #2
Dec 1st, 2008
Implies your stringlist creation didnt work correctly. or that listview1.items[i].Caption is not assigned.
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 17
Reputation: darkyere is an unknown quantity at this point 
Solved Threads: 0
darkyere darkyere is offline Offline
Newbie Poster

Re: acces violation at address 004b84 in module "SecurityScreensaver.exe"

 
0
  #3
Dec 1st, 2008
i found the answer elsewhere

for i := 0 to Listbox.Items.Count - 1 do

is the corrected problem
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: acces violation at address 004b84 in module "SecurityScreensaver.exe"

 
0
  #4
Dec 1st, 2008
yep that would do it.
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 17
Reputation: darkyere is an unknown quantity at this point 
Solved Threads: 0
darkyere darkyere is offline Offline
Newbie Poster

Re: acces violation at address 004b84 in module "SecurityScreensaver.exe"

 
0
  #5
Dec 3rd, 2008
Originally Posted by LizR View Post
Implies your stringlist creation didnt work correctly. or that listview1.items[i].Caption is not assigned.
thank you for the answer btw.

I appreciated the time u used to see where the problem may have been.

Best regards,
darkyre
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: acces violation at address 004b84 in module "SecurityScreensaver.exe"

 
0
  #6
Dec 3rd, 2008
Despite missing the lack of -i what I said still stands, as of course item[i] was 1 too high so wasnt defined .. but then I guess thats partly what debuggings for
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Pascal and Delphi Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC