Avatar of MikeDotNet555
MikeDotNet555

asked on 

(C#) DllImport and dll loading question

1. If I load 2 instance of my program wich use the same dll (using [DllImport]) wich was written in delphi,  will a different instance be loaded for each different app or will the dll be loaded once and answer the calls from both instances of my app?

2. If the answer to question 1 is that it use the same dll instance, would copying the folder and running each instance of the program from different folders have different results?

3. Is there an alternative to load dll's explicitly instead of calling dllImport? For example, would something like the code snippet below be possible?
var myDll = LoadDll("MyLib.dll");
myDll.DoSomething();

Open in new window

.NET ProgrammingC#

Avatar of undefined
Last Comment
MikeDotNet555

8/22/2022 - Mon