code (unmanaged) guarded by a try-catch block. How can I know that the
__except. Is there any disadvantages to this? Can't I just filter the
On Monday, October 26, 2009 8:23 PM Sanje?v wrote:
Though why I would wanna catch an access violation, is not related to
the problem. Here is why, anyway:
My program allows third-party dlls to be loaded into its address space
as plugins. But I surely would not want my application to crash due to
a faulty third-party dll doing something stupid like dereferencing a
NULL pointer. So, I thought why not guard the point where my
application calls functions in the third-party dll and if an access
violation is thrown, just unload the faulty dll and notify the user
that a problem has occurred due to a plugin and the program has
downgraded? I only want to catch an access violation error and allow
my application to crash (default behaviour) if other serious errors
occur.
A 'try/catch(...)' willl catch an access violation error but is not
able to identify if its really an access violation or any other error.
Is __try/__except only the way out of this?
-Sanjeev
On Monday, October 26, 2009 8:23 PM Sanje?v wrote:
is
I could do that but why bother all the tedious IPCs? With two
processes, I will have to copy bitmap objects (and similarly other
objects required by my application) back and fro, make sure of mutual
exclusion of shared data, ahh all that already gives me an headache.
Isn't my technique a better choice? Does it have any side-effects?
Still waiting for answer to my question.
Thanks all for replying,
Sanjeev
On Monday, October 26, 2009 8:23 PM Sanje?v wrote:
I see what you mean. But as I said earlier copying data to and fro two
processes is tedious. I heavily use bitmap object and DCs between my
application and plugins. As HBITMAP and HDC are not usable across
processes, extracting bitmaps from HDCs, extracting and copying bitmap
header and bits into address space of plugin process and again doing
the same from the plugin process as a return bitmap from the function
in plugin is...I do not know...dirty? How have been applications using
plugins been doing all these years?
Here is another approach to the problem. If there was a way to protect
my application code with READ and EXECUTE only permissions before
entering plugin code, then my application could not be in inconsistent
state if plugin code tried to write where it was not supposed to. If
plugin code referenced NULL pointers then access violation could be
caught without ambiguity.
-Sanjeev
Submitted via EggHeadCafe
ASP.NET Sum of Numbers Captcha Control with CustomValidator
http://www.eggheadcafe.com/tutorials/aspnet/bde8bf73-c31c-4c73-af05-861769e625e8/aspnet-sum-of-numbers-captcha-control-with-customvalidator.aspx