Attribute VB_Name = "Module1"
Private Sub Command1_Click()
  Dim gs As GeoStruct
  Dim dms As DMSStruct
  Dim eflag As Integer
  Dim Hemi As String * 1
  'latitude1
  dms.Degrees = 10#
  dms.Minutes = 0#
  dms.Seconds = 0#
  dms.Sign = Sgn(dms.Degrees)
  gs.Latitude1 = DMStoD(dms)
  
  'longitude1
  dms.Degrees = 18#
  dms.Minutes = 0#
  dms.Seconds = 0#
  dms.Sign = Sgn(dms.Degrees)
  gs.Longitude1 = DMStoD(dms)
  
  'Azimuth12
  dms.Degrees = 0#
  dms.Minutes = 0#
  dms.Seconds = 0#
  dms.Sign = Sgn(dms.Degrees)
  gs.Azimuth12 = DMStoD(dms)
  
  gs.Distance = 9655977.366   'meters
  gs.geoid = 5                'NAD27
  
  eflag = VDirect(gs)
  If eflag = WICNOERROR Then
    Call DtoDMS(gs.Latitude2, dms)
   If dms.Sign = -1 Then
     Hemi = "S"
   Else
     Hemi = "N"
   End If
    Label1.Caption = "Latitude2: " & _
                    Format(dms.Degrees, "00") & Chr(WICDEGSIGN) & _
                    Format(dms.Minutes, " 00") & Chr(WICMINSIGN) & _
                    Format(dms.Seconds, " 00.000") & Chr(WICSECSIGN) & _
                    Hemi
    Call DtoDMS(gs.Longitude2, dms)
   If dms.Sign = -1 Then
     Hemi = "W"
   Else
     Hemi = "E"
   End If
    Label2.Caption = "Longitude2: " & _
                    Format(dms.Degrees, "000") & Chr(WICDEGSIGN) & _
                    Format(dms.Minutes, " 00") & Chr(WICMINSIGN) & _
                    Format(dms.Seconds, " 00.000") & Chr(WICSECSIGN) & _
                    Hemi
    Call DtoDMS(gs.Azimuth21, dms)
    Label3.Caption = "Azimuth21: " & _
                    Format(dms.Degrees, "000") & Chr(WICDEGSIGN) & _
                    Format(dms.Minutes, " 00") & Chr(WICMINSIGN) & _
                    Format(dms.Seconds, " 00.000") & Chr(WICSECSIGN)
  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 VDirect"
  lblMessage.Caption = "Press Do It! to convert or Quit to quit"
  Label1.Caption = ""
  Label2.Caption = ""
  Label3.Caption = ""
  Label4.Caption = ""
  
End Sub
