Batch File to Replace Time OBJs in VC++ w/ C/C++ 7.0 OBJs

ID: Q104242

7.00 | 1.00 MS-DOS | WINDOWS kbprg

The information in this article applies to:

SUMMARY

In Microsoft C/C++ version 7.0, the time() function returns the number of seconds elapsed since 00:00:00, December 31, 1899, Universal Coordinated Time. In Visual C++ version 1.0, time() returns the number of seconds that have elapsed since 00:00:00, January 1, 1970, Coordinated Universal Time.

If a developer wants to work with Visual C++ version 1.0 and continue using the time convention of C/C++ version 7.0, the batch file below can be used to replace the time .OBJs of the Visual C++ libraries with the time .OBJs of the C/C++ 7.0 libraries.

MORE INFORMATION

To use the batch file, type the following

   MVTMOBJS <source_library> <target_library>

where source_library is the C/C++ 7.0 library; target_library is the Visual C++ library. For example:

   MVTMOBJS C:\C700\LIB\MLIBCEW C:\MSVC\LIB\MLIBCEW

MVTMOBJS.BAT Batch File

@echo off if %1.==. goto givedirs if %2.==. goto givedirs rem rem Extract needed objects from the source library (%1) rem echo %1 /p:16/NOE >mvtmobjs.rsp echo *stat.obj *fstat.obj *asctime.obj *dtoxtime.obj& >>mvtmobjs.rsp echo *gmtime.obj *localtim.obj *mktime.obj *strftime.obj& >>mvtmobjs.rsp echo *timeset.obj *tzset.obj *ftime.obj *time.obj; >>mvtmobjs.rsp echo ; >>mvtmobjs.rsp lib @mvtmobjs.rsp rem rem Substitute extracted objects into target library (%2) rem echo %2 /p:16/NOE >mvtmobjs.rsp echo -+stat.obj -+fstat.obj -+asctime.obj -+dtoxtime.obj& >>mvtmobjs.rsp echo -+gmtime.obj -+localtim.obj -+mktime.obj -+strftime.obj& >>mvtmobjs.rsp echo -+timeset.obj -+tzset.obj -+ftime.obj -+time.obj; >>mvtmobjs.rsp echo ; >>mvtmobjs.rsp lib @mvtmobjs.rsp rem rem Clean up rem del stat.obj del fstat.obj del asctime.obj del dtoxtime.obj del gmtime.obj del localtim.obj del mktime.obj del strftime.obj del timeset.obj del tzset.obj del ftime.obj del time.obj del mvtmobjs.rsp goto fini rem rem Print out usage syntax rem :givedirs echo Mvtmobjs.bat is a batch file to move all the CRT objects affected by echo the change of the base date/time for time_t values back to midnight, echo January 1, 1970 (UTC) from one C library to another. It will echo propagate the relevant C 7.00 objects to a C 8.00 library.

echo        Usage: mvtmobjs source_library target_library
rem
rem All done! rem :fini

Additional reference words: kbinf 1.00 7.00 KBCategory: kbprg KBSubcategory: CRTIss Keywords : kb16bitonly

Last Reviewed: July 23, 1997