Re: CFileDialog in Threads
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Sat, 04 Feb 2006 21:39:46 -0500
But early on, the rule "don't create UI objects in secondary threads" was given. In spite
of this, you keep asking how to make them work.
If you need to save a file, you have the main GUI thread ask the question. And the
question about how to change the caption seems remarkably silly, because even if you were
doing it in a child UI thread, that thread should know what the caption should be and set
it before launching the dialog. Therefore, there is no need for another thread to change
the caption. And if it were a CFileDIalog launched by some binary plugin, the need to
handle this could be dealt with by a hook function that was executing in the same thread
as the creation, again eliminating any need to do cross-thread detection or modification.
Threading is complex, but adding gratuitous complexity which runs against the core advice
("don't touch a window from another thread"), and persisting in the need to use threads
for this purpose, is what I've been trying to point out is just trying to force a bad
implementation to work, instead of explaining the real problem and asking for a solution
that does not involve threads.
It would never have occurred to me to use threads for this purpose. First, because they
aren't needed. Second, they would involve a lot of complexity that appears to be easily
avoidable by simply not using threads.
joe
On 4 Feb 2006 00:48:29 -0800, akshay4friend@xxxxxxxxx wrote:
my current modified code working fine which is created using aboveJoseph M. Newcomer [MVP]
link. I am creating a thread in which I am watching window creation for
save dialog box using FindWindow and I can very well crosscheck handle
is of my required window. Can you point out possible error in this ??
my problem, how can I solve it?"This is a typical question: "Tell me how to make my bad solution work" instead of "Here's
Joseph it seems you have not read this FULL THREAD. Read my ALL
comments what I asked along with my code. 1st thing I already mentioned
I am new to threading second I already asked 'how should I get handle
to File Save Dialog Box 'after it invoked and also how to find its
invoked completely and appeared' SO I didnt said I want to get work my
existing code only which may be wrong !!!
As used here http://www.codeproject.com/shell/iesaveas.asp I am
creating only one thread now to watch created window and I am running
ActiveX in main GUI thread only but I dont need to use hooks for my
purpose.
Akshay
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- Follow-Ups:
- Re: CFileDialog in Threads
- From: akshay4friend
- Re: CFileDialog in Threads
- References:
- CFileDialog in Threads
- From: akshay4friend
- Re: CFileDialog in Threads
- From: Joseph M . Newcomer
- Re: CFileDialog in Threads
- From: Joseph M . Newcomer
- Re: CFileDialog in Threads
- From: akshay4friend
- CFileDialog in Threads
- Prev by Date: Re: Implementing activation in my app
- Next by Date: Re: heeeeeeeeeeeeeeeellllllllllllllppppppppppppppppppppp
- Previous by thread: Re: CFileDialog in Threads
- Next by thread: Re: CFileDialog in Threads
- Index(es):
Relevant Pages
|