 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Jon Gill Guest
|
Posted: Mon Nov 08, 2004 11:11 pm Post subject: XP sp2 access violation error |
|
|
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
|
Posted: Wed Nov 10, 2004 1:54 am Post subject: Re: XP sp2 access violation error |
|
|
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
|
Posted: Wed Nov 10, 2004 9:30 pm Post subject: Re: XP sp2 access violation error |
|
|
--
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
|
Posted: Fri Nov 12, 2004 12:51 am Post subject: Re: XP sp2 access violation error |
|
|
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 |
|
 |
|
|
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
|
|