in Education by
I'm using a 3rd party DLL written in unmanaged C++ that controls some hardware we have. Unfortunately this DLL crashes now and then and I've been tasked to make it "reload" automagically. I'm not too sure about how to proceed to get best results. My project uses C++.Net 2.0 (2005). I'm wrapping the 3rd party stuff in a separate DLL. I've been trying to FreeLibrary() and LoadLibrary(). However when I FreeLibrary(), some internal DLL dependencies remain allocated and LoadLibrary() will make it crash because of corrupted memory. Another approach that was suggested was to refactor the whole project using .NET remoting interfaces. It would make it easier to kill another process and restart it but it will be a lot of work. Any suggestions? Pointers? Hints? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
The most effective approach will be to not load that DLL in your application's process at all. Instead, create a second process whose only job is to use that DLL on behalf of your application. You can use a shared memory region, local socket, or other IPC mechanism to control the proxy process. This way, when the problematic DLL crashes, you can simply allow the proxy process to die without worrying about the (nearly impossible) task of trying to make sure the DLL didn't corrupt anything important on its way down. Your main process need only start a new instance of the proxy process and carry on.

Related questions

0 votes
    I'm using a 3rd party DLL written in unmanaged C++ that controls some hardware we have. Unfortunately ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    I'm using a 3rd party DLL written in unmanaged C++ that controls some hardware we have. Unfortunately ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 5, 2022 in Education by JackTerrance
0 votes
    I'm using a 3rd party DLL written in unmanaged C++ that controls some hardware we have. Unfortunately ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 5, 2022 in Education by JackTerrance
0 votes
    I have an interface that I have defined in C++ which now needs to be implemented in C#. What is ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 26, 2022 in Education by JackTerrance
0 votes
    I have an interface that I have defined in C++ which now needs to be implemented in C#. What is ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 25, 2022 in Education by JackTerrance
0 votes
    How many messages does the queue for a standard window hold? What happens when the queue overflows? The ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 19, 2022 in Education by JackTerrance
0 votes
    I see many user interface control libraries for .NET, but where can I get similar stuff for win32 using ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 25, 2022 in Education by JackTerrance
0 votes
    There are two strings in a program. Each of them contains a path to some file or folder. How can ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    There are two strings in a program. Each of them contains a path to some file or folder. How can ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    There are two strings in a program. Each of them contains a path to some file or folder. How can ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    I'm working on some idea connected with RS-232 interface manipulation. I can open this port, configure it ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    Your client noticed last month that his ad is often shown next to another advertiser's ad for the same search ... to other advertisers? Select the correct answer from above options...
asked Dec 1, 2021 in Education by JackTerrance
0 votes
    What does 3rd theorem that describe the stability of a set of nonlinear dynamical systems? (a) shows the stability of ... d) none of the mentioned Please answer the above question....
asked Sep 5, 2022 in Education by JackTerrance
0 votes
    The property of a transaction that persists all the crashes is (a) Atomicity (b) Durability (c) Isolation ... , Database Interview Questions and Answers for Freshers and Experience...
asked Oct 11, 2021 in Education by JackTerrance
...