Board index » cppbuilder » Error closing application

Error closing application

Everytime I close my appliction I'm building whether it be through my exit
menu item or the windows X in the upper right hand area of the window I get
the following error

"Project MyProject.exe raised exception class EAccessViolation with message
'Access violation at address 772C34A0.  Read of address 772C34A0'.  Process
stopped.  Use Step or Run to continue."

Why am I getting this error and how can I fix it, I tried just about
everything and can't figure it out.  I'm using BCB 5 and I compiled the
program in BCB 4 originally and it did it there as well.  Any help will be
greatly appreciated.

Aaron

 

Re:Error closing application


On Tue, 3 Jul 2001 19:50:07 -0500, "Aaron Bieberitz" <ABieber...@charter.net>
wrote:

Quote
>Everytime I close my appliction I'm building whether it be through my exit
>menu item or the windows X in the upper right hand area of the window I get
>the following error

>"Project MyProject.exe raised exception class EAccessViolation with message
>'Access violation at address 772C34A0.  Read of address 772C34A0'.  Process
>stopped.  Use Step or Run to continue."

Hi Aaron,  

   have you tried to examine the call stack (Ctrl+Alt+S or View->Debug
Windows->Call Stack), in order to trace where's the place of the offending
code?  

Ciao!

Giuliano

Re:Error closing application


Do you have anything going on in the CloseQuery or OnClose events of the
main form (or any other open forms)?

Jason

Quote
"Aaron Bieberitz" <ABieber...@charter.net> wrote in message

news:3b426812$1_1@dnews...
Quote
> Everytime I close my appliction I'm building whether it be through my exit
> menu item or the windows X in the upper right hand area of the window I
get
> the following error

> "Project MyProject.exe raised exception class EAccessViolation with
message
> 'Access violation at address 772C34A0.  Read of address 772C34A0'.
Process
> stopped.  Use Step or Run to continue."

> Why am I getting this error and how can I fix it, I tried just about
> everything and can't figure it out.  I'm using BCB 5 and I compiled the
> program in BCB 4 originally and it did it there as well.  Any help will be
> greatly appreciated.

> Aaron

Re:Error closing application


Quote
Aaron Bieberitz wrote:
> Everytime I close my appliction I'm building whether it be through my exit
> menu item or the windows X in the upper right hand area of the window I get
> the following error

> "Project MyProject.exe raised exception class EAccessViolation with message
> 'Access violation at address 772C34A0.  Read of address 772C34A0'.  Process
> stopped.  Use Step or Run to continue."

> Why am I getting this error and how can I fix it, I tried just about
> everything and can't figure it out.  I'm using BCB 5 and I compiled the
> program in BCB 4 originally and it did it there as well.  Any help will be
> greatly appreciated.

I got this when I was running a quick report in another thread.  When I
moved it back into the main thread my problem went away.  MIght help...

KenF

Re:Error closing application


Quote
On Wed, 04 Jul 2001 21:22:30 +1000, Ken Foskey <wara...@spamcop.net> wrote:

[snip]

Quote
>I got this when I was running a quick report in another thread.  When I
>moved it back into the main thread my problem went away.  MIght help...

Seems that you don't terminate correctly the secondary thread when you are
closing the application. That is, when the main thread doesn't run anymore,
and the associate memory has been de-allocated, the other thread make some
access to the process memory.

In primis, you have to "gently" terminate the secondary thread, then close
your application in order to avoid that issue.

Don't forget that the main application thread have to "cooperate" with the
secondary thread in order to terminate "gently" this latter thread.

Ciao

Giuliano

Re:Error closing application


I don't have anything in the CloseQuery or OnClose events of the main form
nor am I using a QuickReport yet.  Some of the other posts about threads I'm
completely baffled on because not only do I not have any other threads
anywhere, I'm not even that good at programming threads and this problem
started as soon as I built this program, without any fancy VCL components.

"Jason R. Hall" <arc...@opticmail.com> wrote in message
news:3b4274ee$1_1@dnews...

Quote
> Do you have anything going on in the CloseQuery or OnClose events of the
> main form (or any other open forms)?

> Jason

> "Aaron Bieberitz" <ABieber...@charter.net> wrote in message
> news:3b426812$1_1@dnews...
> > Everytime I close my appliction I'm building whether it be through my
exit
> > menu item or the windows X in the upper right hand area of the window I
> get
> > the following error

> > "Project MyProject.exe raised exception class EAccessViolation with
> message
> > 'Access violation at address 772C34A0.  Read of address 772C34A0'.
> Process
> > stopped.  Use Step or Run to continue."

> > Why am I getting this error and how can I fix it, I tried just about
> > everything and can't figure it out.  I'm using BCB 5 and I compiled the
> > program in BCB 4 originally and it did it there as well.  Any help will
be
> > greatly appreciated.

> > Aaron

Re:Error closing application


Quote
> Why am I getting this error and how can I fix it, I tried just about
> everything and can't figure it out.  I'm using BCB 5 and I compiled the
> program in BCB 4 originally and it did it there as well.  Any help will be
> greatly appreciated.

Most Access Violation messages my applications have generated have been the
result of the application {*word*259}ling memory... normally I am not setting it
up or clearing it properly.

Check your code for where you are allocating memory by using the "new"
keyword:

ie    Somewhere in your app.

...
TSomeObject Myobject = new TSomeObject();
...

and make sure that for every object you create using "new" you clear by
calling "delete" before exiting you application:

ie   When exiting/destroying your app.

...
delete MyObject;
...

If you having troubles finding out what is causing the problem try
commenting out ALL methods/functions and code so your app will only be a
shell and then run and you shouldn't get any AV errors.  Now start adding
single method/functions back in by uncommenting them and run again until you
find which function is generating the AV error.  Was you know what function
it is in you can then comment out the individual lines and do the same as
above adding them back in until you find out what is causing it.

Hope this helps
Scott Kent-Collins

Other Threads