Ok heres the general gyst of what im trying to do.
Ive got an ActiveX OCX embedded in my main form that serves as a network browser, showing computers and shares on the local network. Ive written a method into this called buildIndex() that goes thru and enumerates all the computers and shares and writes them to a text file. All this works fine.
The problem is coming when I call this buildIndex function within my program, the whole thing, as you might imagine, locks up completely as it scans the network and writes out to the file. You can begin clicking again when the indexing is complete. So naturally, i have looked all over for threading information. Ive done 4 tutorials and downloaded about 3 examples with code. However none of these do quite what im looking for.
When im building this index, I have another form that i put on top of the main one that says "building index..." and has a progress bar that just scrolls itself to show that its working. However, using a thread to call the buildIndex is still rendering my program inoperable for the duration. Ive tried everything imaginable as far as i know and nothings working!!!
ideally these are the steps that need to happen:
1) call the buildIndex function of the ocx object into a thread to operate asynchronously
2) display frmIndexing, and have the progressbar (run by a timer) going as the indexing is occuring
3) upon the flag of the indexBuilt event in the ocx object, stop the timer on frmIndex, and close frmIndex.
All the while i need to be able to still be clicking around the program if at all possible.
if you have any ideas please let me know! ive messed with delegates, thread(), threadstart(), begininvoke(), and invoke() from both sides (all executed on frmIndex, or all on frmMain, as well as mixed)
THANKS!
Brandon
Ive got an ActiveX OCX embedded in my main form that serves as a network browser, showing computers and shares on the local network. Ive written a method into this called buildIndex() that goes thru and enumerates all the computers and shares and writes them to a text file. All this works fine.
The problem is coming when I call this buildIndex function within my program, the whole thing, as you might imagine, locks up completely as it scans the network and writes out to the file. You can begin clicking again when the indexing is complete. So naturally, i have looked all over for threading information. Ive done 4 tutorials and downloaded about 3 examples with code. However none of these do quite what im looking for.
When im building this index, I have another form that i put on top of the main one that says "building index..." and has a progress bar that just scrolls itself to show that its working. However, using a thread to call the buildIndex is still rendering my program inoperable for the duration. Ive tried everything imaginable as far as i know and nothings working!!!
ideally these are the steps that need to happen:
1) call the buildIndex function of the ocx object into a thread to operate asynchronously
2) display frmIndexing, and have the progressbar (run by a timer) going as the indexing is occuring
3) upon the flag of the indexBuilt event in the ocx object, stop the timer on frmIndex, and close frmIndex.
All the while i need to be able to still be clicking around the program if at all possible.
if you have any ideas please let me know! ive messed with delegates, thread(), threadstart(), begininvoke(), and invoke() from both sides (all executed on frmIndex, or all on frmMain, as well as mixed)
THANKS!
Brandon