Solved

CFileDialog Thread

Posted on 2001-06-20
8
499 Views
Last Modified: 2013-11-20
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
Comment
Question by:edupas2
8 Comments
 
LVL 49

Accepted Solution

by:
DanRollins earned 100 total points
ID: 6212729
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
 
LVL 10

Expert Comment

by:makerp
ID: 6213180
dont happern on any of my applications that use a CFileDialog, i just checked two
0
 

Expert Comment

by:gilad_no
ID: 6213294
It is rather a question, not an answer, but which performance monitor are you using ? I am looking for one too.
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

Author Comment

by:edupas2
ID: 6214197
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
 
LVL 10

Expert Comment

by:makerp
ID: 6214209
NT :), thats on server and workstation
0
 
LVL 86

Assisted Solution

by:jkr
jkr earned 100 total points
ID: 6214440
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
 
LVL 49

Expert Comment

by:DanRollins
ID: 6216634
>>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
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 9490029
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

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How do you programatically show and hide the Windows 10 On-Screen-Keyboard? 3 666
Define unique primary key 9 92
substring method in java 1 120
Making an alias 7 95
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question