|
Thanks Saurabh,
I read it and it looks like PowerShell scripts. I think my requirement is common. There is no such existing tools?
regards,
George
|
|
|
|
|
Since you need to monitor threads you assume that your requirement is common. But that is not the case! What exactly are you trying to do anyway? Do you want to spy other processes or monitor you own process?
-Saurabh
|
|
|
|
|
Thanks Saurabh,
I am using admin. Why do you think monitor status for threads (wait, executing or something) is not common? Any performance analysis needs such tools.
regards,
George
|
|
|
|
|
What do you mean by "I am using admin"??
If I want to analyze performance of an application I will use a profiler. I have no control over how threads will be scheduled, for how long they have to wait, etc. Hence knowing how long my thread waits for IO will lead me nowhere w.r.t. optimization. On the other hand profiler will tell me how much time each function takes and how many times it is called during an execution. Using this I can try to optimized expensive and more frequently functions.
By the way, Rajesh gave you perfect tool for monitoring threads but still you insist on tool from MS because there will be more help for it. What kind of support do you expect from a tool which just shows thread information? I mean there is nothing more to it other than displaying thread information.
-Saurabh
|
|
|
|
|
Thanks Saurabh,
Help from your guys are good enough now.
regards,
George
|
|
|
|
|
George_George wrote: I am using admin
Can you more explain?
|
|
|
|
|
Thanks Hamid!
Sorry for my bad English. I mean I am using Administrator Group account to monitor, so no security concern.
Any ideas about how to monitor threads' status?
regards,
George
|
|
|
|
|
I have a dialog with 2 Date Time Picker.
The first is m_date with Short Date format
The second is m_time with Time format
CDateTimeCtrl dateBox;
CDateTimeCtrl timeBox;
Then I want to get the timestamp from them, the final result should be in __int64 (to compare with database and something else). An example is 1214878775000 for a SYSTEMTIME
wYear 2008
wMonth 7
wDayOfWeek
wDay 1
wHour 11
wMinute 19
wSecond 35
wMilliseconds 734
Try to look at the MSDN, there are many stupid things: CTime, SYSTEMTIME, FILETIME, .... blah blah .... with a alot of functions.
Is it really that difficult or I go the wrong way? Does anyone have some way to to this?
Here I got the result with a function like this way:
__int64 CMyDlg::getTimestamp()
{
__int64 nTime;
CTime tmpTime;
int nYear, nMonth, nDay, nHour, nMin, nSec;
dateBox.GetTime( tmpTime );
nYear = tmpTime.GetYear(); nMonth = tmpTime.GetMonth(); nDay = tmpTime.GetDay();
timeBox.GetTime( tmpTime );
nHour = tmpTime.GetHour(); nMin = tmpTime.GetMinute(); nSec = tmpTime.GetSecond();
CTime navTime( nYear, nMonth, nDay, nHour, nMin, nSec );
SYSTEMTIME ST;
FILETIME FT;
navTime.GetAsSystemTime(ST);
SystemTimeToFileTime(&ST,&FT);
__int64 nSetTime;
memcpy(&nSetTime, &FT, sizeof(FILETIME));
MyFormatter formatter;
nTime = formatter.FileTimeToJavaTime(nSetTime);
nTime -= 9 * 60 * 60* 1000;
return nTime;
}
It use another class MyFormatter that I cannot understand. I really hate these stupid stuff !!!
Does anyone have a simple way to get timestamp?
Thank you in advance,
|
|
|
|
|
While it's not completely portable, have you tried:
SystemTimeToFileTime(&ST,&FT);
__int64 *nTime = (__int64 *) &FT;
return *nTime;
"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
|
|
|
|
|
thank you, DavidCrow
it works, and a little bit better. but I mean, here is the progress:
from dialog item -> CTime variable -> another CTime var -> SYSTEMTIME var -> FILETIME var -> __int64 result
well, I think it's too much. It's too complex for newbie in VC++, also. And the most is: is it really necessary to be like that???
Do you have a simplier solution for this?
Does anyone have?
thank you very much,
modified on Tuesday, July 1, 2008 1:17 AM
|
|
|
|
|
tataxin wrote: Do you have a simplier solution for this?
Not by much. What about:
__int64 CMyDlg::getTimestamp( void )
{
SYSTEMTIME stDate;
m_date.GetTime(&stDate);
SYSTEMTIME stTime;
m_time.GetTime(&stTime);
stDate.wHour = stTime.wHour;
stDate.wMinute = stTime.wMinute;
stDate.wSecond = stTime.wSecond;
FILETIME ft;
SystemTimeToFileTime(&stDate, &ft);
__int64 *nTime = (__int64 *) &ft;
return *nTime;
}
"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
|
|
|
|
|
Oh nice, DavidCrow!!
At least we don't have to use CTime. so the process will be
from dialog item -> SYSTEMTIME var -> FILETIME var -> __int64 result
It works,
Thank you very much!!
|
|
|
|
|
You're right. It's way too complex. The insane complexity started with MFC in the mid/late 1990s. I think Java became popular around then because people were disgusted with the complex crap from Microsoft.
In response, Microsoft created a more sane platform, C# and .NET, copying a lot from Java. The simpler solution is to switch to C#. It's amazing how much simpler everything is in C#.
|
|
|
|
|
Hahaha, it's a good idea to change to Java or C#, Alan Balkany.
But I have no choice in my projects. Just my boss decided it.
Anyway, thank you for that,
|
|
|
|
|
it due to what you want to.
but for the code you provided, i think it will not work, although i didn't look it completely.
for example, dateBox.GetTime( tmpTime ); may not retrieve the right time value you want, it due to how the funtion you implemented.
btw, you can select CTime to work for you, but time_t, and there are many other time types available, like you used.
|
|
|
|
|
I think because there're many types, so it makes me confused.
I just want to use the simple way,
And, dataBox.GetTime(tmpTime) works, I get the correct value I need
|
|
|
|
|
yes.
i did say dataBox.GetTime(tmpTime) may not work, i used 'may', not 'must'.
lol.
it due to your implement, if you use its inner point, of course it work, right? lol
|
|
|
|
|
you're right,
so i'm lucky because it works, even I don't know what is inner point, I just let dataBox is the member of the dialog.
can you show me the document about inner point so I can read about it.
thank you, kcynic,
|
|
|
|
|
dateBox.GetTime( tmpTime );
in this line, you might only want to retrieve a time value from your dialog. what i said inner point means in the tmpTime, if it isn't a CTime object, you should use points the new values and return, otherwise, you can't return the right value via tmpTime, right?
especially, for c++ class, there are two copying ways: simple copy and deep copy. Almost every C++ book will refer it, you can look up it.
modified on Tuesday, July 1, 2008 11:11 PM
|
|
|
|
|
Hi,
I want to able to have tabs with different CView classes in each tab, how is this done? Is there any tutorials or sample code to do this?
Thanks in advance!
|
|
|
|
|
I did something similar to it sometime back. check this, this and this
the fruits of your success will be in direct ratio to the honesty and sincerity of your own efforts in keeping your own records, doing your own thinking and, reaching your own conclusions.
..surviving in autumn..in love with spring..
|
|
|
|
|
Hi, Im working on an accessibility application. I am using visual C++ with mfc in visualstudio2008.
In windows vista, if you right click on desktop >> go to colors and appearance >> click "Advanced...", you reach an 'appearance settings dialog box where you can change the colors of anything in windows. Windows xp also had this app, i think you right click on desktop, choose backgrounds, and then go to the appearances tab and click advanced (or something like that).
Here you can change color of title bars, menus etc. You will notice in this dialog box there is a view, and in this view are a few little windows. As you choose different colors from the options, the view updates to reflect the changes. So if you, say, change the title bars to red, then in the little view the title bar of the windows will turn red.
My question is how do you simulate this behavior in your own app. My app too has similar features by which the user can change some colors, and i want to have that same sort of view in it so the user can see what a change looks like. Is it possible to make a little view box with some windows inside the way microsoft has done there?
Note, I am already aware of how to use setsyscolor function to make system colors change. What I want is to simulate that view microsoft has over there so my app is as easy to use as the default one in windows.
In addition, is there some way to simply open that 'appearance settings' dialog box from within my own app? I might just opt for that if it seems like the best option..
|
|
|
|
|
See here for XP[^]. See if this helps
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I am currently writing an interactive cloth simulation program and I am going to need the GUI to be displayed on a variety of platforms including a native PC application and the web. The problem is with the latter. I am currently writing this app using C++ and OpenGL, and I'm not quite sure how to get it to display web side. I know that there are OpenGL implementations for Java, but I don't know Java that well and do not have the time to really learn it.
I've considered separating the simulation code into it's own dll and writing a renderer for each platform, but I'm not even sure what data will need to be sent between the two applications. Should the simulation dll actually include an OpenGL implementation and simply pass final rendered scene to the display app, or should the display app handle all of the rendering.
Any suggestions or advice would be very helpful. Thanks in advance,
Dustin
|
|
|
|
|
A way to do it would be to render the image to a memory bitmap within an ISAPI extension[^]
That way you could use the same C++ OpenGL code for both the desktop and web version.
|
|
|
|
|