|
|
SandipG wrote: And finally hijacked!!
Whom??
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
cup of coffee also help
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
CPallini wrote: QueryPerformanceFrequency/QueryPerformanceCounter pair make the best (while still reliable) choiche for you
damm i missed it!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
I will suggest that you run this function a large number of times. Take the total time and the compute the average time, this way you will have more realistic measure of time function takes.
-Saurabh
|
|
|
|
|
[EDIT] Yeah, what he said. (seems I had the reply window open longer than I thought )
I don't quite understand what the big deal is - am I really missing something really obvious? This just seems like a relatively simple exercise in maths to me, with the added fun of error estimation and minimization.
There's 1,000ms in a second right. So, if I can complete 2,000 events in 1,000 ms then each event is taking 1,000 / 2,000 = 0.5ms.
So then if I complete something 5,000,000 times in 1,000ms, each event is taking 0.0002 ms, or 1/5,000,000 = 0.0000002s - we've already measured/calculated the time of completion to 1/5000th the resolution of the millisecond timer.
Something to consider though is that as the time of each event becomes smaller and smaller, the overhead of the loop becomes a higher and higher margin of the error. The other major source of error is task-switching. This makes timing such an event in a non-realtime os more than a bit of a challenge.
Things that can help you minimize these errors are to
(i) kill all unnecessary processes first
(ii) complete the maximum number of events you can - a longer sample time will help give more consistant results.
(iii) start the timing loop on a keypress. This will allow you to start your program, set it's priority to "realtime" and then get timing.
Lets say I have a loop that calls my function 14 times per iteration(inlining the code would be much better than calling a function of course). Next, I time 500 million iterations of my loop and find that it completes in 2785 ms. So, I can tell that I'm getting 179,533.2136 loop iterations per millisecond. I then multiply this by 14 and find that I'm getting 2,513,464 function calls per millisecond.
This would correspond to 2.5 function calls per nanosecond. (not a result you could hope to get close to, given current clock-rates of cpus and the error-inducing factors I mentioned above, but that's the basic idea)
|
|
|
|
|
Hi,
How can I select tree item at right click?
|
|
|
|
|
|
when you click the tree item whether right or left it will automatically be selected.I am not sure, are you asking about to handle right click of tree control?
|
|
|
|
|
At the left click it will select but not with the right click
|
|
|
|
|
U r right MPTP, actually i am using the tree ctrl and selecting the item using SelecteItem function, hence it's getting selected for left as well as right,By default it does not gets selected on right click.
Thanks.
|
|
|
|
|
How to disable a button , which is already using ON_UPDATE_COMMAND_UI ?I mean other than handling inside the function,As for example one condition check should disable a set of seven buttons ,Instead of doing it individually, can we use any other way .
modified on Thursday, July 17, 2008 7:04 AM
|
|
|
|
|
kDevloper wrote: How to disable a button , which is already using ON_UPDATE_COMMAND_UI ?
Use CCmdUI::Enable() .
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Please have look at my modified query?
|
|
|
|
|
I'm not really sure what you are asking? Since I don't know what your post looked like before you modified it, I don't know what you changed.
Are you wanting to know how to disable more than one button via a single function call?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Dear All,
I working on financials and stock market data. I need a solution where my application has to be updated by server everytime i recived price updates of stock. which technology i need to use in desktop applications. And my client never make any request to the server. all the updates avilalable will be throughed by server.
just like push server but need to implement in c++.
is there any technology which can i implement ?
kindly help me in this issue.
Jalsa
|
|
|
|
|
How are the clients and server connected?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
jalsa G wrote: And my client never make any request to the server. all the updates avilalable will be throughed by server.
my gut feeling say (i might be wrong?) Most probably you server might be web server!, you could put HTTP request to retieve data from the server!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
Hello everyone,
Both stdcall and cdecl calling convention could support variable input parameters? Is that correct?
(I think stdcall is using RET N and cdecl is using ESP - N, so both are capable to handle variable number of input parameter, like printf?)
BTW: I have this question because I have something in mind that only one of them supports variable number of parameters, but after reading assembly language code, I think both of them are able to support this feature?
thanks in advance,
George
|
|
|
|
|
George_George wrote: Both stdcall and cdecl calling convention could support variable input parameters? Is that correct?
I dont think so. Only cdecl will be able to support variable number of arguments. Because in stdcall, the stack is cleaned by the called function. That means that function should know how much variables it accepts at the compile time it self.
But in the case of cdecl, the caller should clean the stack. Since the caller is pushing the variables to stack, it correctly know how much size to should pop from stack
modified on Thursday, July 17, 2008 5:58 AM
|
|
|
|
|
Thanks nave,
What is the root cause why stdcall does not support variable number of input parameter? Maybe from generated assembly, we could find out?
(I think both caller and callee could get # of input parameters from stack in theory?)
regards,
George
|
|
|
|
|
how could callee found out the number of paremeters from the stack in the case of variable arguments? Also the size of each argument also need to be known isn't it?
|
|
|
|
|
Thanks nave,
I think the reason why stdcall can not have variable number of input parameter is, we can not have a common code which is capable to pop variable number of input parameters (a specific function is common code base, and needs common code to pop a specific number (not variable) of elements from stack, but if input parameter number is variable, it is impossible to have such a common code base), correct?
regards,
George
|
|
|
|
|
|
Thanks Naveen,
Question answered.
regards,
George
|
|
|
|