I am making a C# DLL plugin for a EXE written in VB6. I do not have access to the source of the EXE. The DLL itself works and communicates fine with the EXE.
Here is the process for a event:
- User issues command on EXE which then calls a function in the DLL, passing an object as a parameter
- DLL processes data which sometimes takes a long time
The DLL responds by calling a function of the object that was passed. The DLL function itself does not return anything
public void DoCommand(object CommandSettings) { //ObjectVB6 is my custom class to allow easy calling of COM methods and properties ObjectVB6 CS = new ObjectVB6(CommandSettings); ... //process data CS.CallMethod("MyReply", args); }
My problem is that during long queries (from the DLL), the EXE's UI freezes.
What is the best way to prevent this? I have tried using asynchronous MySQL queries, which were no good, and tried using multiple threads, which just run into protected memory issues.
Any advice you can provide would be awesome. Been trying to address this issue for days. Thanks.