Discussion:
MFC SDI Windows Explorer type application related query?
(too old to reply)
Davinder
2005-12-07 09:33:49 UTC
Permalink
Hi
My existing project is an MFC Windows explorer type SDI application.
Now there is a situation where a heavy process(reading hard disk) goes on
for say 2-3 minutes & then based on this process a running tree of existing
dirs in the system is created.
Also at the same time the status bar panes 0 & 1 are updated.
Pane 0 shows the count of total dirs found & added to tree.
Pane 1 shows the total size of the folders added to tree.


Now there are few problems here:

1.-->At the time the heavy process is going on & the user switches to some
other application and then returns back, the gui of my application
disappears & a
blank white screen is displayed.

2.-->At the time the running tree is being created, if the user drops down
some menu item or presses the left/right mouse button the creation of the
running tree is stopped.

I want to solve these two issues.

After doing some surfing on the net i thing that using the concept of the
Multithreading will solve my problem.

Waiting for suggestions

Best Regards
Tom Serface
2005-12-07 16:10:02 UTC
Permalink
I think I saw that Scott answered this in another thread, but one thing to
add is that you will want to pace your updates to the status bar. Perhaps
you want to only update every few seconds or every 10 or 20 files. That
will speed up your read a lot for large folders. Your UI is going away
because the process of loading the controls is taking a long time. You can
do a message check PeekMessage() during that loop or put it in a worker
thread and update the status bar using a message to the main thread. If you
do a worker thread do not try to update the status bars directly (or any
other window in the main thread).

Tom
Post by Davinder
Hi
My existing project is an MFC Windows explorer type SDI application.
Now there is a situation where a heavy process(reading hard disk) goes on
for say 2-3 minutes & then based on this process a running tree of existing
dirs in the system is created.
Also at the same time the status bar panes 0 & 1 are updated.
Pane 0 shows the count of total dirs found & added to tree.
Pane 1 shows the total size of the folders added to tree.
1.-->At the time the heavy process is going on & the user switches to some
other application and then returns back, the gui of my application
disappears & a
blank white screen is displayed.
2.-->At the time the running tree is being created, if the user drops down
some menu item or presses the left/right mouse button the creation of the
running tree is stopped.
I want to solve these two issues.
After doing some surfing on the net i thing that using the concept of the
Multithreading will solve my problem.
Waiting for suggestions
Best Regards
Davinder
2005-12-08 08:10:23 UTC
Permalink
Thanx a lot for the suggestion

Best Regards
Post by Tom Serface
I think I saw that Scott answered this in another thread, but one thing to
add is that you will want to pace your updates to the status bar. Perhaps
you want to only update every few seconds or every 10 or 20 files. That
will speed up your read a lot for large folders. Your UI is going away
because the process of loading the controls is taking a long time. You can
do a message check PeekMessage() during that loop or put it in a worker
thread and update the status bar using a message to the main thread. If you
do a worker thread do not try to update the status bars directly (or any
other window in the main thread).
Tom
Post by Davinder
Hi
My existing project is an MFC Windows explorer type SDI application.
Now there is a situation where a heavy process(reading hard disk) goes on
for say 2-3 minutes & then based on this process a running tree of existing
dirs in the system is created.
Also at the same time the status bar panes 0 & 1 are updated.
Pane 0 shows the count of total dirs found & added to tree.
Pane 1 shows the total size of the folders added to tree.
1.-->At the time the heavy process is going on & the user switches to some
other application and then returns back, the gui of my application
disappears & a
blank white screen is displayed.
2.-->At the time the running tree is being created, if the user drops down
some menu item or presses the left/right mouse button the creation of the
running tree is stopped.
I want to solve these two issues.
After doing some surfing on the net i thing that using the concept of the
Multithreading will solve my problem.
Waiting for suggestions
Best Regards
Loading...