I have a C# .NET Framework application that calls an unmanaged C++ DLL via DLLImport
, to parse a bunch of files given by the user and perform some operations.
I would like to have a progress bar on my C# application, as this file parsing might be a long process. The best way I have thought to do this is to parse a couple of files at a time, and then return to the C# code so I can update the progress bar.
However, this requires me to allocate some memory on the heap of the C++ DLL so I don't have to pass all the 10,000+ file paths as arguments each time I have to call the C++ function again.
I am not sure if closing the DLL after I have completed my parsing is possible. Is there any other way I can accomplish this task without having to keep all of the paths in memory allocated for the entirety of the time that the application is running?