It makes no sense. There is not such thing as "call a DLL" or "wait for DLL". You always call a function; and when you do, the calling thread is executing that function until it returns, not doing anything else. It does not matter where the function is, in a DLL or in the same executable module where you do the call. Moreover, for .NET, it does not matter if some module is DLL or EXE: the central concept of .NET is
assembly, which consists of
modules, most usually one per assembly.
You would need to consider waiting (more exactly, thread synchronization and wait states associated with them) if you use multithreading. But as your question suggests that you just need to do two things in sequence, just do it all in one thread. The problem simply does not exist.
If you really need to do something in parallel (say, just keep UI responsive until all that UI work completes), this is not a big problem, too. You need to do communication in a separate thread and notify UI when some action is complete.
The problem is that you have to communication between UI thread and some other thread. You cannot call anything related to UI from non-UI thread. Instead, you need to use the method
Invoke
or
BeginInvoke
of
System.Windows.Threading.Dispatcher
(for both Forms or WPF) or
System.Windows.Forms.Control
(Forms only).
You will find detailed explanation of how it works and code samples in my past answers:
Control.Invoke() vs. Control.BeginInvoke()[
^],
Problem with Treeview Scanner And MD5[
^].
See also more references on threading:
How to get a keydown event to operate on a different thread in vb.net[
^],
Control events not firing after enable disable + multithreading[
^].
—SA—SA