|
Actually i done calculation in worker thread and display sum result on modelless dialog box that show on Main dialog box,so i want to display wait cursor here .
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
You can do a BeginWaitCursor / EndWaitCursor .
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Let the worker thread work and the UI thread handle the UI: setting the cursor is part of the UI.
Steve
|
|
|
|
|
I have handlw to that window
Trioum
modified on Friday, June 12, 2009 2:03 AM
|
|
|
|
|
trioum wrote: how can we send a ctrl+V message to window .I have handlw to that window
You can use WM_PASTE , if it's an edit control, directly and your intention is to paste some text from clipboard. Also you can try SendInput[^].
|
|
|
|
|
|
You should not be doing such a thing though, you've been asking it for something like a month here. So...
Send key-stroke messages in this order:
Control (Key down)
S (key down)
S (key up)
Control (Key up)
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
|
|
ok
Trioum
modified on Friday, June 12, 2009 2:01 AM
|
|
|
|
|
How would I know what were you doing? Is it difficult for you to show me your code?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
ok I use
Trioum
modified on Friday, June 12, 2009 2:01 AM
|
|
|
|
|
yet i solve my problem
Trioum
modified on Friday, June 12, 2009 2:02 AM
|
|
|
|
|
Hi,
what would be the output of following code:
main()
{
int a=1;
printf ("%d", a+=(a+=3,5,a));
}
In VC++ it is showing output: 8
In AS/400’s C showing output: 5
If it is complier dependent, plz tell me the logic of both the answers.
"We can't solve problems by using the same kind of thinking we used when we created them"
modified on Monday, June 8, 2009 6:08 AM
|
|
|
|
|
IMHO VC++ answer makes sense.
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]
|
|
|
|
|
It's a correct answer, but maybe not what was intended.
It seems to be evaluating it as ((a+=3), 5, a) and returning the new value of 'a' (the AS/400 compiler returns the old value of 'a' I think).
I'll have to find a precedence table, as I'd have expected it to be (a += (3, 5, a)), which would give a different result (4)...
edit : looks like the assignment has higher precedence, according to MSDN. You learn something new every day
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
int <font color=red>a</font> = 1;
a += ( <font color=red>a</font>+= 3, <font color=gray>5, a</font> );
a += ( <font color=red>a</font>+= 3 );
a += ( a = <font color=red>a</font>+3)
a += a;
shubhi wrote: In AS/400’s C showing output: 5
Then that compiler sucks.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
But according to sequential Evaluation:
say If,
a=(b+=2,5,2)
then it will evaluate b+=2 but a will get the value 2, as I m using the braces here.
So i think in my question it is evaluating the a+=3 but finally it is resulting the value of last argument.
a += ( a+= 3, 5, a ); //a=1
a += ( a );//a=4
kindly correct me know if I m wrong.
"We can't solve problems by using the same kind of thinking we used when we created them"
|
|
|
|
|
shubhi wrote: then it will evaluate b+=2 but a will get the value 2, as I m using the braces here.
You're right there.
shubhi wrote: a += ( a+= 3, 5, a ); //a=1
Yes, the value of a (the last within the braces) is 1 , so adding 3 to it makes it 4 . And then there is an a+=a . Therefore 8.
It is a crappy thing, but it's life -^ Carlo Pallini
modified on Monday, June 8, 2009 7:04 AM
|
|
|
|
|
Rajesh R Subramanian wrote: a cannot get the value 2, because the expression b+=2 will be executed before it is assigned to a, for the very reason that it is inside braces. Therefore, the value of a would be b+2.
I think you're wrong, here (and the OP question was indeed more subtle than I origianlly understood).
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]
|
|
|
|
|
Yes, that was subtle indeed. Modified my answer.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Just to add
For eg we have
e1 , e2
Here ',' act as operator which will ``evaluate the subexpression e1, then evaluate e2; the value of the expression is the value of e2.
So for a+=(a+=3,5,a) it will have as:-
a+=(4,5,4)// since a=a+3
So in all a=8.
But not sure of AS/400 C Compiler. Might be it is evaluating as:-
a+=(a+=3.5,a)
a=a+(a=a+3,5,a)
a=1+(4,5,4)
a=5 // But i am not sure with this explanation.
|
|
|
|
|
Anoop Dashora wrote: But not sure of AS/400 C Compiler. Might be it is evaluating as:-
a+=(a+=3.5,a)
a=a+(a=a+3,5,a)
a=1+(4,5,4)
a=5 // But i am not sure with this explanation.
You could generate the assembly and have a look at it, couldn't you?
[added]
Probably you can't, since you're not the OP...
[/added]
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]
|
|
|
|
|
Hello, I modified a portion of my previous answer. To be specific,
shubhi wrote:
a=(b+=2,5,2)
then it will evaluate b+=2 but a will get the value 2, as I m using the braces here.
That is correct.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Who cares what the answer is or should be or whatever - the lesson you should be learning from this question is just don't do this sort of thing.
[edit]To expand on that - whenever some part of a language specification is defined as "implementation specific" or (as I think the C++ Standard says for cases like yours) "undefined", especially when it's language semantics like this, be afraid, be very afraid, and leave it well alone, as far as you are able.[/edit]
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
modified on Monday, June 8, 2009 8:30 AM
|
|
|
|
|