BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

XP sp2 access violation error

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Installation
View previous topic :: View next topic  
Author Message
Jon Gill
Guest





PostPosted: Mon Nov 08, 2004 11:11 pm    Post subject: XP sp2 access violation error Reply with quote



I have written an application in Delphi 6.

All works fine in XP sp1, however, when using XP sp2
my application fails when I attempt to execute an opendialog box
to open a file (within my application) and gives the error "access violation
error".

Does anyone know why this should be and is there a fix?


Jon


Back to top
Wayne & Carr
Guest





PostPosted: Wed Nov 10, 2004 1:54 am    Post subject: Re: XP sp2 access violation error Reply with quote



What is the code that you are using?
That is giving the access violation

Wayne
"Jon Gill"
Quote:
I have written an application in Delphi 6.

All works fine in XP sp1, however, when using XP sp2
my application fails when I attempt to execute an opendialog box
to open a file (within my application) and gives the error "access
violation
error".

Does anyone know why this should be and is there a fix?


Jon





Back to top
Jon Gill
Guest





PostPosted: Wed Nov 10, 2004 9:30 pm    Post subject: Re: XP sp2 access violation error Reply with quote





--
Here's the code I'm using. It works fine on XP SP1 but won't work on XP SP2

Jon


procedure TForm1.Button1Click(Sender: TObject);

var fileextension: string;
l: integer;
button: integer;
outpath: ansistring;
stream: tfilestream;


begin

if opendialog1.execute=true then
begin

try
Stream:=TFileStream.Create(opendialog1.filename,fmOpenReadWrite);
except
showmessage('The file is either read-only or is being used by another
application.'+#13+
'Please ensure the file is closed and that the file is NOT read-only and try
again'+#13+#13+
'Possible cause: you are currently using the file within MS Word, MSExcel,
Adobe Acrobat'+#13+
'or another application');
exit;
end;
stream.destroy;

l:=length(opendialog1.filename);
fileextension:=copy(opendialog1.filename,l-2,3);

Button := Application.MessageBox('Are you sure you want to Publish the
current document'+#13, 'You are about to do something profound!', mb_YESNO +
MB_ICONINFORMATION +
mb_DefButton1);
if Button = IDYES then
begin
OUTPATH:=EXTRACTFILEPATH(OPENDIALOG1.FILENAME);
SHOWMESSAGE(OUTPATH);
end;

if Button = IDNO then
begin
exit;
end;

end;
end;

Jon






"Wayne & Carr" <nospam@1.net> wrote

Quote:
What is the code that you are using?
That is giving the access violation

Wayne
"Jon Gill"
I have written an application in Delphi 6.

All works fine in XP sp1, however, when using XP sp2
my application fails when I attempt to execute an opendialog box
to open a file (within my application) and gives the error "access
violation
error".

Does anyone know why this should be and is there a fix?


Jon







Back to top
Jon Gill
Guest





PostPosted: Fri Nov 12, 2004 12:51 am    Post subject: Re: XP sp2 access violation error Reply with quote

I've discovered the error and have now fixed it.

Jon






"Jon Gill" <jon (AT) wamburg (DOT) co.uk> wrote

Quote:


--
Here's the code I'm using. It works fine on XP SP1 but won't work on XP
SP2

Jon


procedure TForm1.Button1Click(Sender: TObject);

var fileextension: string;
l: integer;
button: integer;
outpath: ansistring;
stream: tfilestream;


begin

if opendialog1.execute=true then
begin

try
Stream:=TFileStream.Create(opendialog1.filename,fmOpenReadWrite);
except
showmessage('The file is either read-only or is being used by another
application.'+#13+
'Please ensure the file is closed and that the file is NOT read-only and
try
again'+#13+#13+
'Possible cause: you are currently using the file within MS Word, MSExcel,
Adobe Acrobat'+#13+
'or another application');
exit;
end;
stream.destroy;

l:=length(opendialog1.filename);
fileextension:=copy(opendialog1.filename,l-2,3);

Button := Application.MessageBox('Are you sure you want to Publish the
current document'+#13, 'You are about to do something profound!', mb_YESNO
+
MB_ICONINFORMATION +
mb_DefButton1);
if Button = IDYES then
begin
OUTPATH:=EXTRACTFILEPATH(OPENDIALOG1.FILENAME);
SHOWMESSAGE(OUTPATH);
end;

if Button = IDNO then
begin
exit;
end;

end;
end;

Jon






"Wayne & Carr" <nospam@1.net> wrote in message
news:41917516$1 (AT) newsgroups (DOT) borland.com...
What is the code that you are using?
That is giving the access violation

Wayne
"Jon Gill"
I have written an application in Delphi 6.

All works fine in XP sp1, however, when using XP sp2
my application fails when I attempt to execute an opendialog box
to open a file (within my application) and gives the error "access
violation
error".

Does anyone know why this should be and is there a fix?


Jon









Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Installation All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.