I download .dll written in Delphi 7 using DllImport in a Windows service written in C # .NET 4. Before deploying this service, I just want to make sure that I donβt need to do anything specifically to handle unmanaged .dll.
My C # code looks something like this:
[DllImport("MyDelphiDLL.dll")] private static extern string DoSomething(string value); private void SomeMethod(List<string> values) { foreach (string value in values) { string newValue = DoSomething(value); } }
The DoSomething function will be called several times, and I suspect that MyDelphiDLL.dll is loaded either when the managed DLL is loaded, or the first link to DoSomething, but I'm not sure.
I looked at the DllImportAttribute Class documentation on MSDN, but actually it is not anyway. I also searched for SO, and Googled the question every way I can think of, and still have not found a definitive answer.
I just want to make sure everything is correct.
source share