So you have an event that is shared across your process. Your UI creates a thread that waits on the event (unless you dont mind the UI being blocked in which case the main thread can wait on the event.
Your processing thread then sets that even when it is done.
Your UI (main thread or wait thread) then gets its wait satisfied and goes on to notify the user.
Your solution is unreliable because in case of a child process crash you wait for the event forever. If you wait for the process handle on the thread then its an alternative for the WM_TIMER polling with multithreading.
Why do you assume he is using a child process and you can of course timeout on an event or trigger the event for all sorts of reasons.
Of course we dont knoq the design of his code, if he is creating a work thread to do the transfer, but he asked about events, not about spawning processes, so your answer to him and to me is still wrong.
I assume a child process because he has written about it in the body of the messasge: "running a commandline operation". What is this if not a child process or in some extreme circumstances a process launched somewhere else? But you know what, let OP to decide that: he never told that it isn't a child process.
What happens if you timeout the event? You start waiting for it again? Or you assume that the process has terminated when it is still running? And how do you signal to the gui thread when the event becomes signaled without bleating on SendMessage/PostMessage/PostThreadMessage? I think we can safely ignore "bleating on" this because OP probably knows this all...
OP tries to solve a problem and he isn't using the right tools, that's it. Maybe the title of the question was only about events but have you read the body of the message? I provided some alternative solutions because as many other problems this one can also be solved in many ways - all of them having its pros/cons. The solution involves waiting/polling the process handle either from a thread or from a periodic event from 1 thread.
My advice to OP was using the poll solution because beginner's multithreading solutions are buggy in 99% of the cases and polling is a perfect alternative in this case, wait cancellation is also easier to implement with polling.
My advice to you: Learn how to respect people and how to talk to them accordingly. Giving wrong answers and making mistakes is okay, submitting positive criticism is OK, submitting destructive criticism and destroying morale on the forums is not okay, treating yourself and your solutions perfect in contrast to others and others' solution is not okay. As I previously mentioned respect is mutual or nonexistent. The fact that my post is "too" long according to you is unimportant. Whether my solution is good or not? Let OP and others decide...
And you know what? Why don't you submit your solutions if you think you are that smart?
I am trying to change the tree view control's appearance using vc++. Initially it has + and - minus symbol when expanding and vice verse. Now i want to change the + and - symbol to arrow mark.
To bring the + and - minus symbol we can use the following default functionality
Thanks for your reply. But i was not talking about the folder change. The content which you was sent is about icon change. But i want to change the + and - symbol to arrow mark in the tree view control.
I couldn't attach the screenshot here. Its look like,
I want to change the arrow mark symbol instead that [+] and [-]
Whether you can create a file on a disk driver at a specified location may depend on more factors than a list of allowed unicode characters burnt into windows. One such factor can be the filesystem of the drive you are writing to. For this reason I think the previously mentioned CreateFile() test is probably one of the best and most reliable solutions.
well I want to make career in programing and i am very good in c programming which i learn ownself, now i would learn next which programming language which have better career scope ! is it good to learn java ?
please anyone help me ?
Last Visit: 31-Dec-99 19:00 Last Update: 7-Dec-23 9:47