Attribute VB_Name = "Module1"
Private Sub Command1_Click()
  Dim gs As GeoStruct
  Dim dms As DMSStruct
  Dim eflag As Integer
  
  '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)
    
  'latitude2
  dms.Degrees = 83#
  dms.Minutes = 11#
  dms.Seconds = 48.545
  dms.Sign = Sgn(dms.Degrees)
  gs.Latitude2 = DMStoD(dms)
  
  'longitude2
  dms.Degrees = 162#
  dms.Minutes = 0#
  dms.Seconds = 0#
  dms.Sign = Sgn(dms.Degrees)
  gs.Longitude2 = DMStoD(dms)
  
  gs.geoid = 5                'NAD27
  
  eflag = VInverse(gs)
  If eflag = WICNOERROR Then
    Call DtoDMS(gs.Azimuth12, dms)
    Label1.Caption = "Azimuth12: " & _
                    Format(dms.Degrees, "000") & Chr(WICDEGSIGN) & _
                    Format(dms.Minutes, " 00") & Chr(WICMINSIGN) & _
                    Format(dms.Seconds, " 00.000") & Chr(WICSECSIGN)
    Call DtoDMS(gs.Azimuth21, dms)
    Label2.Caption = "Azimuth21: " & _
                    Format(dms.Degrees, "000") & Chr(WICDEGSIGN) & _
                    Format(dms.Minutes, " 00") & Chr(WICMINSIGN) & _
                    Format(dms.Seconds, " 00.000") & Chr(WICSECSIGN)
    Label3.Caption = "Distance: " & Format(gs.Distance, "0,000,000.000") & _
                      " Meters"
  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 VInverse"
  lblMessage.Caption = "Press Do It! to convert or Quit to quit"
  Label1.Caption = ""
  Label2.Caption = ""
  Label3.Caption = ""
  Label4.Caption = ""
  
End Sub
