Enhanced Time for VB5-based WINS applications
Requires wcSDK
Public Domain license (see documentation below)


INTRODUCTION
Now if you program in VB5, you can quickly and easily convert from the
FileTime variable format used by WINS to hold information such as the user's
expiration date to the new Date variable format used by VB5. The advantage
of converting to VB5's internal Date format is the ability to use powerful
functions like DateAdd and DateDiff. See your VB5 documentation for
instructions on using these commands and the Date variable type.

This module includes three new functions:

DateToFileTime(d as date) as FileTime
FileTimeToDate(f as FileTime) as Variant - can be assigned to a date variable
FileTimeToString(f as FileTime) as String

These modules can be used in your program to quickly and easily convert and
display dates. In all cases, the time value is ignored -- although all the
variables mentioned provide for storing time data in addition to date data,
WINS does not appear to make use of the time data, so it is ignored during the
conversion processes.


REQUIRED FILES:
You must have the wcSDK installed -- specifically, the wcvb.bas module must be
included in your project, and the wcvb.dll must be distributed with your
project. This module also makes Win32 API calls, which should not be an issue
since WINS requires Win95 or WinNT.


COMPATIBILITY:
As far as I know, this module is NOT compatible with versions of Visual Basic
prior to version 5. It has only been tested under VB5 Enterprise Edition with
Service Pack 3 installed.


EXAMPLES:
The following lines of code are from an actual working program. These are not
intended as a VB5 tutorial, but assume you have a working knowledge of VB5.

  ' Get user's expiration date, add 4 months to the end, and then add a
  ' comment to the msg variable

  Dim uExpireDate As Date

  If User.ExpireDate.dwHighDateTime = 0 And User.ExpireDate.dwLowDateTime = 0 Then
    ' Date is blank, so let's fill it with NOW
     uExpireDate = Now
  Else
     uExpireDate = FileTimeToDate(User.ExpireDate)  ' Get user's expiration date
  End If

  uExpireDate = DateAdd("m", 4, TempDate)  ' Add 4 months to user's expiration date
  User.ExpireDate = DateToFileTime(uExpireDate)  ' Update user's expiration date
  if UpdateUser(User) then
    msg = msg + "Your new expiration date is: " + FileTimeToString(User.ExpireDate)
  end if

In all these examples, the variable User is of type TUser, and was previously
populated using the GetUserByID function from the wcvb.bas module.


WARRANTEE
This module is not guaranteed, warranteed, or represented to be suitable to
any specific purpose. Use at your own risk. Modify at your own risk. If it
breaks, it's your problem, not mine.


LICENSE
This module is released to the public domain by the author, Earl Borah,
provided this readme.txt file accompanies any distribution of the source code.
It may be modified by end users, provided a copy of the modifications are sent
via email to Earl Borah at earl.borah@bbs.chemek.cc.or.us

This module may be used in any project, commercial or otherwise, without any
payments being made to the author. Enjoy.

Earl Borah is the author of Web Messaging Professional for WINS, the essential
addon for systems that make extensive use of the DHTML interface. Visit
http://bbs.chemek.cc.or.us/public/ring/sysop.htm for the latest information on
WMP98 and other programs released by Earl Borah.

Visual Basic, Windows, Windows 95, and Windows NT are registered trademarks of
Microsoft Corporation.