The DLL is being loaded dynamically but in a static kind of way.  It 
stays loaded for a long time and sits there doing it's thing.  It's 
while it's doing it's own thing, not interacting with my app, that an AV 
can occur.  I believe the DLL uses a separate thread to perform some 
activities.  The AV occurs just after it's finished doing what it needs 
to do, so I don't need the DLL to continue at that stage; I can unload 
it, but I was hoping to be able to stop the AV appearing to the user.

The Delphi (7) debugger is able to trap the error and display the memory 
address where it's jumping to, so I thought perhaps there is a way for 
my app to trap it as well.

Ross.

----- Original Message ----- 
From: "Martin" <[EMAIL PROTECTED]>
To: "Borland's Delphi Discussion List" <[email protected]>
Sent: Thursday, October 13, 2005 1:17 PM
Subject: Re: Ignoring AV errors in DLL's


How are you linking in the dll, are you dynamically loading the dll on
the fly, or do you have it statically linked? If you are loading
dynamically you should be able to use the try..except in your code. If
you load it statically then you really cant trap any errors generated by
the dll unless it is around the calling procedure/function.

Regards
Martin.

Ross Levis wrote:

>I have an app which is loading a 3rd party DLL.  The DLL is causing an
>access violation in certain circumstances.  The DLL cannot be modified
>and fixed so I was wondering and hoping if there is some way to ignore
>the AV error so it doesn't popup a windows error dialog.
>
>I can't use try..except  in my code because the error occurs while the
>DLL is doing it's own thing, not when I'm calling a function directly 
>in
>the DLL, so there is no where to put the try..except encapulation.
>
>The debugger can catch the error so there must be some way to get 
>around
>it.  I've tried a TApplication.OnException event but this is not being
>triggered.
>
>Any ideas?

_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to