How to make 16 bit application access the system time in NT?
=?iso-8859-1?Q?Kl=E5vus_Stefan?= -- SKS@ausys.se Wednesday, January 08, 1997 Environment: VC++ 1.52, Win NT 3.51/4.0 I'm working on a 16 bit application running in NT. The application is using the CTime class (and CTime::GetSystemTime()). The problem is that if anyone changes the system time in NT, this isn't replicated to the 16 bit environment. On the other hand changing the date is replicate to the 16 bit environment. Assume that the 32 bit time is 00:00:00 and the 16 bit time is 23:45:00. When NT changes the the date this is also done in the 16 bit application (still with the same time). The time in the 16 bit application is then approximately 24 hours wrong... What I need know is if there is any way to get the "real" system time (32 bit) and not the one that the Virtual DOS Machine is using? I tried to catch the WM_TIMECHANGE message by overriding OnTimeChange() in the 16 bit application but it didn't work (never got the message). Thanks in advance /Stefan ________________________________________________ Stefan Kl=E5vus AU-System Communication AB Box 47612, Liljeholmstranden 3 S-117 94 Stockholm Tel +46-8-726 75 00, fax +46-8-19 33 22 sks@ausys.se http://www.ausys.se
Brad P. Exchange -- Brad.P.Smith@Cognos.COM Thursday, January 09, 1997 >> >I'm working on a 16 bit application running in NT. The application is >using the CTime class (and CTime::GetSystemTime()). The problem is that >if anyone changes the system time in NT, this isn't replicated to the 16 >bit environment. << What a coincidence, I just hit that the other day. As you've probably noticed, that's a known design oddity in NT, and there is a KnowledgeBase article explaining why. If you can't find it on Microsoft's Web Site, I can try and locate it for you. >> >What I need know is if there is any way to get the "real" system time >(32 bit) and not the one that the Virtual DOS Machine is using? << The aforementioned KnowledgeBase article very strongly implies that you can't. It says that starting up the VDM takes a "snapshot" of the then-current system time, and there's no mechanism to update it. In addition, *another* KnowledgeBase article states that if you change the system time/date from within your 16-bit app, that change is also not reflected up to the operating system, and only applies to your VDM (or is it all running 16-bit apps?). Anyway, I can find that KB article too if you need it. If you *do* find a solution, please be sure to post it in the list (and/or E-mail it to me). :-) Brad. >-- >Brad P. Smith - Software Designer >Cognos Inc.; 3755 Riverside Dr.; Ottawa, Ontario, CANADA; K1G 4K9 >Voice: (613) 738-1440 ext 3702 FAX: (613) 738-0002 >Internet: smithb@bpsmicro.com or smithb@cognos.com >
IGNACIO NICOLAS RODRIGUEZ -- irodriguez@envirolink.org Saturday, January 11, 1997 I fyou really need the time, why dont you biuld an OLE Automation server with a function GetTime(). Of course, a 32bits out-of-pocess server. Sorry for the spelling. Ignacio. irodriguez@envirolink.org Nothing more powerfull, nothing easier than pwerfull simple OLE.
| Вернуться в корень Архива |