Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 534
  • Last Modified:

CFileDialog Thread

I am using performance monitor to watch my applications thread count and I have noticed something strange:

When I create a CFileDialog object a new thread is spawned, but when this object is destroyed the thread stays.  At first I created the object on the stack, then switched to the heap so I could handle (de)allocation manually.  Neither approach seem to make a difference.

Any ideas as to why this is happening?

Since I have no handle to the thread, how can I kill it?
0
edupas2
Asked:
edupas2
2 Solutions
 
DanRollinsCommented:
It sounds strange, but it could explain something... I have noticed that the first time I bring up an OpenFile dialog, the system takes a while, but that subsequent times, it goes faster.  Perhaps the system is keeping that thread alive and reusing it on subsequent calls.

Does another thread get created if you use CFileDialog again?

-- Dan
0
 
makerpCommented:
dont happern on any of my applications that use a CFileDialog, i just checked two
0
 
gilad_noCommented:
It is rather a question, not an answer, but which performance monitor are you using ? I am looking for one too.
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
edupas2Author Commented:
Subsequent calls do not create additional threads, no.

The viewer being used is perfmon.exe

<<dont happern on any of my applications that use a CFileDialog, i just checked two>>

Perhaps this is just an NT thing? What O/S are you on?
0
 
makerpCommented:
NT :), thats on server and workstation
0
 
jkrCommented:
I could imagine that the system creates a thread that does a 'FindFirstChangeNotification()' to update the CFileDialog dynamically, but that's just a guess also...
0
 
DanRollinsCommented:
>>dont happern on any of my applications that use a CFileDialog, i just checked two

If my theory is correct, the only way to know might be to open an app that uses CFileDialog directly after booting the system.

--  Dan
0
 
Roshan DavisCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Answered by : DanRollins, jkr (points to be split)

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Roshan Davis
EE Cleanup Volunteer
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now