|
When are you starting your thread ? When clicking a button or something ? Can you post some code of the part where you start your thread ?
How is your main thread interacting with the second thread, are you waiting for it to finish or something ?
|
|
|
|
|
Hi,
1.
for good GUI responsiveness you should organize your code such that an event handler (such as a Button click handler) never takes longer than say 30 milliseconds. This implies:
- long computations must be delegated to a thread, backgroundworker, or something similar;
- Thread.Sleep(), Thread.Join() and all kinds of blocking calls are forbidden unless there is a timeout
of only a few tens of milliseconds.
- networking and most I/O are to be avoided (a simple file access to a local file would be OK).
2.
All GUI Controls must be operated on only by the thread that created them, most likely the main thread. Whenever another thread/backgroundworker tries to touch a Control (without Control.Invoke) strange things are bound to happen, most typical would be a total GUI freeze.
3.
The Windows Task Manager interrogates all applications periodically; if it doesn't get a response in a short time (typically because the app failed to observe the above two points), it will report the app as "Not responding" and add such notice to the main window's title.
modified on Monday, January 19, 2009 8:43 AM
|
|
|
|
|
Hi all,
i have an value in terms of seconds like 5400 seconds. (here 1 hour and 30 minute)
how can get value from it in terms of hour and minute.
please help me for this.
thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Dividing by 3600 gives you the number of hours (the result will be 1.5). If you round the result down, you get the number of hours (1). If you take the modulo (%), you will end up with 0.5 and you multiply it by 60 to have the number of minutes.
|
|
|
|
|
int seconds = whatever;
int minutes = (seconds / 60) % 60;
int hour = seconds / 3600;
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
And see here[^].
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
We have developed an application(Form View) which covers complete desktop and hides it. There are few button controls on the form view. On clicking these buttons, another processes were invoked(using shell-execute).
The problem here is when we ciclk on button(say, button1) another application(dialog based) is invoked and show's the dialog on top of above application(Form View), and again on clicking another button(say buton2) invokes another application(dialog based) and the second click event hides the first application(invoked thru button1) to back of application(Form View).
How can we restrict the application's to be shown on top of application(Form View).
The application(Form View)has styles: WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_POPUP;
|
|
|
|
|
What was wrong with the answers you got to this question almost exactly one week ago?
I know I replied with a rambling essay on how screen savers get called to park themselves on a parent window, by passing a window handle as a parameter.
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Thnx for the reply Iain. I know that I have posted the question before. I couldn't find the post so posted agin.
Can you please refer that link.
|
|
|
|
|
It's easy to find your own posts - click on your name in the forum - that'll take you to your profile page. Then click on 'Messages Posted' - that'll take you to a list of messages you have posted, in which you could find your previous questions.
Re-posting a question you've already had answers to will not get the same answers again - more likely you'll get abuse for a) re-posting and b) appearing (at lest) to be an ingrate.
|
|
|
|
|
Haven't you received your replies by email? The link to your post can be found there.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
|
Thank you chandra for the link
|
|
|
|
|
i have a proble regarding visual c++ with msaccess.Friends please send me any simple way to access data from msaccess and how to add data to the table and update as well as...
i hope sombody will send me.For those i tell thanks..
|
|
|
|
|
|
If you are using MFC, check out the CDatabase and CRecordset classes. You may also want to read up on what a DSN is, although one is not required.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
|
I'v a dialog based program with a RichEdit control in it and a few buttons to format the text within it. Now what I wanna do is to be notified whenever the caret positon changes through the lines. (and update the sate of some radio buttons accordingly).
Thank you masters!
|
|
|
|
|
My thinking...
"Golly, what a dumb question. Just look at the edit control, and see what messages it sends back. Probably EN_UPDATE or such."
"Hmm, OK, it's not that... Lets fire up a normal edit and look".
"Hmm, just CTL_COLOREDIT coming back"
lots of other thoughts, but in the end, I found:
EN_SELCHANGE
The EN_SELCHANGE message notifies a rich edit control's parent window that the current selection has changed. A
rich edit control sends this notification message in the form of a WM_NOTIFY message.
To receive EN_SELCHANGE notifications, specify ENM_SELCHANGE in the mask sent with the EM_SETEVENTMASK message.
Note, when there is no selection (that is, the caret is displayed) we have, in fact, the empty selection. Thus,
when the caret position changes (for example, clicking a mouse, typing, or pressing an arrow key), an EN_SELCHANGE
message is sent.
I hope that works for you. Just note that you have to turn notifications on.
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Thank you, It works.
Thank you masters!
|
|
|
|
|
Hi,
I have a TabControl with 2 tabitems in Main Dialog.I have use two dialogs in tab items.Code is:
m_Dialog[0]->Create(m_DialogID[0],GetParent());
m_Dialog[1]->Create(m_DialogID[1],GetParent());
I need to clear All the values in first dialog(first tabitem)while selecting the another dialog(second tabitem).
please help me..............
Thanks & Regards,
Anitha
modified on Monday, January 19, 2009 4:13 AM
|
|
|
|
|
AnithaSubramani wrote: .I need to clear the text box while changing the tabitem.
To clear the text box use SetWindowText("");
MSDN:
As users click tabs or buttons, the tab control (CTabCtrl) sends notification messages[WM_NOTIFY] to its parent window. Handle these messages if you want to do something in response.
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
You can simply map TCN_SELCHANGE[^] and the set/reset the text box using "SetWindowText" API.
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
I need to clear the text box in first tabitem, if i select the second tabitem and vice versa.
|
|
|
|