Private Sub Command1_Click()
  Dim utm As UTMStruct
  Dim dms As DMSStruct
  Dim eflag As Integer
  
  'latitude
  dms.Degrees = 42#
  dms.Minutes = 51#
  dms.Seconds = 10.92
  dms.Sign=Sgn(dms.Degrees)
  utm.Latitude = DMStoD(dms)
  
  'longitude
  dms.Degrees = -73#
  dms.Minutes = 58#
  dms.Seconds = 43.68
  dms.Sign=Sgn(dms.Degrees)
  utm.Longitude = DMStoD(dms)
  
  utm.geoid = 5         'NAD27
  eflag = LL2UTM(utm)
  If eflag = WICNOERROR Then
    Label1.Caption = "Easting: " & Format(utm.east, "###,###.0000") & " Meters"
    Label2.Caption = "Northing: " & Format(utm.north, "#,###,###.0000") & " Meters"
    Label3.Caption = "Zone: " & Format(utm.ZoneNumber, "00") & utm.ZoneLetter
  Else
    lblMessage.Caption = "Error in conversion - error is " & Format(eflag, "00")
  End If
  
End Sub

Private Sub Command2_Click()
  End
End Sub

Private Sub Form_Load()

  lblTitle.Caption = "Testing LL2UTM"
  lblMessage.Caption = "Press Do It! to convert or Quit to quit"
  Label1.Caption = ""
  Label2.Caption = ""
  Label3.Caption = ""
  Label4.Caption = ""
  
End Sub
