Re: CFileDialog in Threads
- From: akshay4friend@xxxxxxxxx
- Date: 5 Feb 2006 02:02:14 -0800
And the question about how to change the caption seems remarkably silly,
I SUGGEST YOU TO READ THIS THREAD AGAIN SPECIALLY READ MY 2ND AND 3RD
COMMENT IN THIS THREAD... CAN YOU PLEASE POINT MY STATEMENT WHERE I AM
ASKING ABOUT ''''''HOW TO SET CAPTION'''''' ?? ITS JUST SAMPLE CODE
TO SHOW SOMETHING ONCE I GOT HANDLE OF FILE DIALOG.....
I ALREADY MENTIONED IN MY 3RD COMMENT THAT GIVEN CODE IS SAMPLE AND
WHAT I ACTUALLY WANT TO DO IS TO CHANGE COMBOBOX VALUE IN SAVE DIALOG
INVOKED BY ACTIVEX CONTROL. THATS IT.
don't create UI objects in secondary threads" was given. In spite of this, you keep asking how to make them work.
AGAIN READ THE FULL COMMENTS AND TELL ME WHERE I ASKED I WANT TO GET
WORK MY EXISTING CODE ONLY ??? IN MY 2ND COMMENT ONLY I CLEARED WHAT I
WANT TO DO AND HOW IT CAN BE ACHIVED BY ANY WAY .....
THANX
AKSHAY
Joseph M. Newcomer wrote:
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: Vipin [MVP]
- 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
- Re: CFileDialog in Threads
- From: Joseph M . Newcomer
- CFileDialog in Threads
- Prev by Date: Re: Problems with the GetFileSecurity function
- Next by Date: Re: CCheckListBox problem in VS 2005
- Previous by thread: Re: CFileDialog in Threads
- Next by thread: Re: CFileDialog in Threads
- Index(es):
Relevant Pages
|