I have a small application I wrote that is essentially just a tight loop monitoring a communications port and sending responses when required. I have utilized DoEvents inside the scanning loop so that the user interface remains usable but now I need to be able to allow the user to save the captured data to a file. The problem is that I cannot find any way to show the OpenFile dialog in an asynchronous, non-modal way.
I have tried both the CommonDialog control and the GetOpenFile API. When using the API I can display the dialog non-modally (my form is still accessible) but it is still a synchronous call. That is to say when show the dialog, my code stops and waits for the return. This is not acceptable as my scanning loop needs to continue to run while the dialog is shown. What I need is to show the dialog asynchronously and have it simply notify me (via an event or callback) when the user closes the dialog (either by selecting a file or canceling).
Can anyone suggest a solution?
Thanks,
Steve
I have tried both the CommonDialog control and the GetOpenFile API. When using the API I can display the dialog non-modally (my form is still accessible) but it is still a synchronous call. That is to say when show the dialog, my code stops and waits for the return. This is not acceptable as my scanning loop needs to continue to run while the dialog is shown. What I need is to show the dialog asynchronously and have it simply notify me (via an event or callback) when the user closes the dialog (either by selecting a file or canceling).
Can anyone suggest a solution?
Thanks,
Steve