Main Form
(general)(Declarations)
	Option Explicit
	Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" _
		(ByVal lpLibFileName As String) As Long

Form Load
	LoadLibrary ("RupFlDlg.Dll")

Module1
(general)(Declarations)
	Declare Function u_nego Lib "ruprsh32.dll" (ByVal whd As Long, ByVal port As Long, ByVal flg As Long, ByVal baud As Long, errcode As Long) As Long
	Declare Function u_end Lib "ruprsh32.dll" (ByVal whd As Long, ByVal port As Long, ByVal flg As Long, ByVal baud As Long, errcode As Long) As Long
	Declare Function u_reset Lib "ruprsh32.dll" (ByVal whd As Long, ByVal port As Long, ByVal flg As Long, ByVal baud As Long, errcode As Long) As Long
	Declare Function u_del Lib "ruprsh32.dll" (ByVal whd As Long, ByVal port As Long, ByVal flg As Long, ByVal baud As Long, ByVal File As String, errcode As Long) As Long
	Declare Function u_mkdir Lib "ruprsh32.dll" (ByVal whd As Long, ByVal port As Long, ByVal flg As Long, ByVal baud As Long, ByVal dpath As String, errcode As Long) As Long
	Declare Function u_rmdir Lib "ruprsh32.dll" (ByVal whd As Long, ByVal port As Long, ByVal flg As Long, ByVal baud As Long, ByVal dpath As String, errcode As Long) As Long
	Declare Function u_chdir Lib "ruprsh32.dll" (ByVal whd As Long, ByVal port As Long, ByVal flg As Long, ByVal baud As Long, ByVal dpath As String, errcode As Long) As Long
	Declare Function u_gtime Lib "ruprsh32.dll" (ByVal whd As Long, ByVal port As Long, ByVal flg As Long, ByVal baud As Long, ymdhms As Byte, errcode As Long) As Long
	Declare Function u_stime Lib "ruprsh32.dll" (ByVal whd As Long, ByVal port As Long, ByVal flg As Long, ByVal baud As Long, ymdhms As Byte, errcode As Long) As Long
	Declare Function u_ver Lib "ruprsh32.dll" (ByVal whd As Long, ByVal port As Long, ByVal flg As Long, ByVal baud As Long, vers As Byte, errcode As Long) As Long
	Declare Function u_copy Lib "ruprsh32.dll" (ByVal whd As Long, ByVal port As Long, ByVal flg As Long, ByVal baud As Long, ByVal sfile As String, ByVal dfile As String, errcode As Long) As Long
	Declare Function u_ren Lib "ruprsh32.dll" (ByVal whd As Long, ByVal port As Long, ByVal flg As Long, ByVal baud As Long, ByVal oldname As String, ByVal newname As String, errcode As Long) As Long
	Declare Function u_download Lib "ruprsh32.dll" (ByVal whd As Long, ByVal port As Long, ByVal flg As Long, ByVal baud As Long, ByVal sfile As String, ByVal dfile As String, errcode As Long) As Long
	Declare Function u_upload Lib "ruprsh32.dll" (ByVal whd As Long, ByVal port As Long, ByVal flg As Long, ByVal baud As Long, ByVal sfile As String, ByVal dfile As String, errcode As Long) As Long
	Declare Function u_gsysfile Lib "ruprsh32.dll" (ByVal whd As Long, ByVal port As Long, ByVal flg As Long, ByVal baud As Long, sysp As Byte, errcode As Long) As Long
	Declare Function u_ssysfile Lib "ruprsh32.dll" (ByVal whd As Long, ByVal port As Long, ByVal flg As Long, ByVal baud As Long, sysp As Byte, errcode As Long) As Long
	Declare Function u_gpower Lib "ruprsh32.dll" (ByVal whd As Long, ByVal port As Long, ByVal flg As Long, ByVal baud As Long, battery As Long, errcode As Long) As Long
	Declare Function u_stdform Lib "ruprsh32.dll" (ByVal whd As Long, ByVal port As Long, ByVal flg As Long, ByVal baud As Long, ByVal level As Long, errcode As Long) As Long
	Declare Function u_format Lib "ruprsh32.dll" (ByVal whd As Long, ByVal port As Long, ByVal flg As Long, ByVal baud As Long, ByVal bytes As Long, ByVal sec As Long, ByVal cyl As Long, ByVal head As Long, ByVal level As Long, errcode As Long) As Long
	Declare Function u_dir Lib "ruprsh32.dll" (ByVal whd As Long, ByVal port As Long, ByVal flg As Long, ByVal baud As Long, ByVal dpath As String, dir_inf As Byte, ByVal leng As Long, space As Long, errcode As Long) As Long
	Declare Function u_chkdsk Lib "ruprsh32.dll" (ByVal whd As Long, ByVal port As Long, ByVal flg As Long, ByVal baud As Long, ByVal ctrl As Long, finfp As Long, ByVal filep As String, eclup As Long, errcode As Long) As Long
	Public port As Long         'Serial port(1`10)
	Public baud As Long         'Baud rate(3:38400bps,4:19200bps)
	Public level As Long        'format level(0:Quick,1:check,2:Full check)

Private Function Dll_nego() As Integer
  Dim ErrN As Long  'Error information
  Dim msg As String, Style As String, Title As String
  Dim Response As Integer
  Dim flg As Long  'DialogBox
    flg = 1 'Time out 1 sec.
    If u_nego(hwnd, port, flg, baud, ErrN) Then
      Style = vbOKOnly + vbCritical
      Title = FormCaption + " - Connection error"
            msg = "Securely place onHand in the docking station." + Chr(13) + Chr(10)
      msg = msg + "Click Yes when onHand enters Ready Mode."
      Response = MsgBox(msg, Style, Title)
      Dll_nego = -1
    Else
      Dll_nego = 0
    End If
End Function

'======================================================================
' Copyright (c) Seiko Instruments Inc. 1998-1999. All rights reserved. 
'======================================================================
