Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:

How to make my application safe from crashing, when at runtime there is possible crash in the DLL it is using.

Example: Say my "Application1" is using third party "dll1". Becuase of some bad programming "dll1" gets a runtime exception in processing call "GetSummary" (just for example) and it crashes. How can I assure my "Application 1" does not crash?

If the DLL is written in C or it is not throwing any exception, how can we handle it?

Posted
Updated 22-Aug-21 5:15am
v3

Actually crash in DLL cannot be solved until u have the source code.

But from your point.

You can place the DLL loading part in try{ ... } catch( ... ){} .

Which will help your application to not get crashed. But i you have to ensure that DLL is not making errors so that DLL functions cannot be used.

 
Share this answer
 
v2
Use C++ exception handling to supress the errors.
 
Share this answer
 
Your question has conflicting information. You say "dll1" "gets a runtime exception" (I imagine you mean "throws a runtime exception"), but you also say "if the DLL is written in C or is not throwing any exception, how can we handle it". Is it or isn't it throwing an exception? And what language is Application1 written in? If it's not throwing an exception, then it shouldn't be a problem. If it is and you're working with C++, then catch the exception and suppress it.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900