c# - How do I call a DLL which does a time consuming task? -

in wpf application, have communicate datastor on serial port. want separate communication class library simplicity.
in dll, issuing command datastor , wait 10 seconds receive response back. once response datastor, compile data meaningful info , pass main application.
my question how make main application pause while data external dll , continue processing data dll?
i use .net 4.0
consider calling dll method in new thread
thread dllexecthread = new thread(dllmethodtoexecute); and providing callback main program dll can executed when complete (this prevents locking on gui).
edit: or simplicities sake if want main program wait dll finish execution subsequently call:
dllexecthread.join();
Comments
Post a Comment