|
We want to keep our system cross-platform.
Any ANSI standard way to get local time in seconds?
Yonggoo
|
|
|
|
|
Yonggoo wrote: Any ANSI standard way to get local time in seconds?
To bad you didn't include that requirement in your first post I might not have wasted my time giving you an answer that you can't use.
led mike
|
|
|
|
|
|
I have tried many ways.
The following worked.
double Clock::getLocalSeconds()const // The local time is hours behind. All else are the sams as UTC time.
{
time_t UtcTimeValue;
time(&UtcTimeValue); //get the system time, which is UTC time
struct tm* UtcHMS= gmtime(&UtcTimeValue); //convert it to struct tm*, which is UTC time
int utcHours = UtcHMS->tm_hour;
time_t LocalTimeValue;
time(&LocalTimeValue); //get the system time, which is UTC time
struct tm* LocalHMS = localtime(&LocalTimeValue); //convert it to struct tm*, which is the local time
int localHours = LocalHMS->tm_hour;
double diffHours =utcHours - localHours;
return ((double)UtcTimeValue - diffHours*SECONDS_IN_HOUR);
}
Yonggoo
|
|
|
|
|
Yonggoo wrote: I could get UTC time in seconds below.
Are they correct?
Have you tried it?
Good luck on January 18, 2038
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
Yonggoo wrote: Are they correct?
You are in the best position to determine that.
Yonggoo wrote: strUtcTime+=" : ";
You are making an assumption here that a colon is always the separator.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi guys i'm just now learning windows programming and need to learn how to change the size of the window dynamically.Please help me with this guys ....I need it urgently guys.
|
|
|
|
|
How about MoveWindow() or SetWindowPos() ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
thanks a lot friend but i asked how to change the size and not to move it.
|
|
|
|
|
rschocks wrote: ...i asked how to change the size...
And I provided you with the names of two functions to do just that.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
K thanks a lot.I will try it.
|
|
|
|
|
if you see MSDN it writes:"changes the position and dimensions of the specified window" and also you can retrives current position of a window if you need
|
|
|
|
|
rschocks wrote: Hi guys i'm just now learning windows programming
Great, it can be a lot of fun. Here is a "tip"... they hide all that information in the DOCUMENTATION[^] so that really beyond breathing the only qualification you need to be a windows developer is READING.
led mike
|
|
|
|
|
Hi,
I am looking for information on how to retrieve a drive's drive letter given the drive's device path (eg: \\?\ide#diskibm-dtla-307030_________________________tx4oa50c#5&230d196c&0&0.0.0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}. I get the device path by registering for device notifications for the GUID_DEVINTERFACE_DISK class and processing the DEV_BROADCAST_DEVICEINTERFACE structure received as part of the notifications.
I tried to do this by matching the device type and device number retrieved by sending IOCTL_STORAGE_GET_DEVICE_NUMBER to all drives on the system, but this method seems to fail if there is a RAM drive on the system. I get multiple drives with the same device type and number. Is this expected behaviour?
Is there a more reliable and simpler way to do this? Any help is greatly appreciated.
Thanks,
Priya
|
|
|
|
|
how to configure ip address through netsh from mfc. i used shell execute but it doesnt work
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
Is it me or netsh is the flavour of the month ? seems that it's a really popular.
|
|
|
|
|
Maximilien wrote: seems that it's a really popular.
Same person.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
i am having a tabcontrol in a dialog. how to close this dialog. some process will be going on behind this dialog. hence i ahve to close this dilaog only.
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
Modal or modeless? MFC or no?
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
Hi all.
I have instal my service and start it now error mesage wos given.
In case my service dont work and Service manager show me that service is runing.
Can help?
|
|
|
|
|
A service gets commands from Windows (such as 'start', 'stop', 'pause', 'resume')
The service has to respond to those commands within a given time. If the service dosent't respond within a given time, Windows shows an error message saying that the service didn't respond.
So the service could be (and often are, IMO) started despite the error message from Windows.
The usual way to handle windows commands is to start a separate thread that's responsive to handling the commands and responding to them.
That way, the service responds the way Windows wants.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
I'm using Visual Studio and wrote a HelloWorld dll which runs under java, using JNI.
If I use the command prompt, it works:
C:\Ilan\OsnatFunc\Debug>java osnat.HelloWorld
Hello World
Now I want to use Visual Studio to put a break point and debug it.
(In this simple case there is nothing to debug, but there will be a next step.)
I assume it should be something under the Property Pages, with Debugging, probably with Command or Command Arguments. I have tried "java osnat.HelloWorld", but that isn't correct.
The question is: what do I use to operate my java project as a main, which will then call the dll where I have my breakpoint?
Thanks,
Ilan
|
|
|
|
|
In order to debug something, the debugger has to attach to whatever process contains the code you are interested in. In the case of DLLs, this means the process that is loading the DLL, and in your case, it sounds like whatever process contains the JVM.
I would suggest trying to find the process that is actually loading your DLL (and running your Java code that calls into it) - if you cannot do this easily, a quick but kludgy way is to write some in the load-time code of your DLL that causes a spin for 15 seconds, allowing you to locate the spinning process in Task Manager, thus identifying the process you need to attach the debugger to.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
How does one normally debug a dll?
I agree one has to start the process which calls the dll.
In my case the process is the JVM.
"java osnat.HelloWorld" starts this process under the command box.
I assume there should be some way to start it under the Visual Studio debug mode?
If I really have no other choice, then I could try to attach to a process that is in some loop, but I hope there is a more direct method.
Ilan
|
|
|
|
|
Yes, the "executable for debug session" will be the full path to the java executable, and the program arguments would be (the full path to?) osnat.HelloWorld .
I would think that would do it. Note that you are not normally able to set breakpoints in a DLL until the DLL has been loaded by the debugger, which usually happens the first time the process-being-debugged loads the DLL.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|