home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 22 / CD_ASCQ_22_0695.iso / win / prg / zipserv / zip_clnt.fr_ / zip_clnt.fr
Text File  |  1995-01-26  |  3KB  |  100 lines

  1. VERSION 2.00
  2. Begin Form ZipClientForm 
  3.    Caption         =   "Zip Client"
  4.    ClientHeight    =   6216
  5.    ClientLeft      =   876
  6.    ClientTop       =   1536
  7.    ClientWidth     =   6420
  8.    Height          =   6636
  9.    Left            =   828
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   6216
  12.    ScaleWidth      =   6420
  13.    Top             =   1164
  14.    Width           =   6516
  15.    Begin CommandButton DDETestButton 
  16.       Caption         =   "&DDE Test"
  17.       Height          =   396
  18.       Left            =   2052
  19.       TabIndex        =   1
  20.       Top             =   2952
  21.       Width           =   2040
  22.    End
  23.    Begin Label DDELabel 
  24.       Caption         =   "Label1"
  25.       Height          =   960
  26.       Left            =   684
  27.       TabIndex        =   0
  28.       Top             =   720
  29.       Visible         =   0   'False
  30.       Width           =   5208
  31.    End
  32. End
  33.  
  34. Sub DDETestButton_Click ()
  35.     Dim DDEMessage$, start&
  36.     'Communicate with hidden Zip Server.
  37.     SourceApp$ = "ZIPSERV"
  38.     SourceForm$ = "ZipForm"
  39.     SourceControl$ = "DDELabel"
  40.     DDELabel.LinkTopic = SourceApp$ + "|" + SourceForm$
  41.     DDELabel.LinkItem = SourceControl$
  42.     On Error Resume Next
  43.     DDELabel.LinkMode = 1'Automatic
  44.     If Err Then
  45.        Err = 0
  46.        X = Shell("C:\ZIPSERV\ZIPSERV.EXE -1")
  47.        DoEvents
  48.        start& = Timer
  49.        Do
  50.           Err = 0
  51.           DDELabel.LinkMode = 1
  52.        Loop Until Err = 0 Or Timer - start& > 1
  53.        If Err Then
  54.           MsgBox IIf(X > 0, "Unable to establish connection with Zip Server. Zip Server was loaded and remained in memory.", "Unable to establish connection with Zip Server. Zip Server was not found.")
  55.           End
  56.        End If
  57.     End If
  58.     'give values here before calling ZipPass
  59.     ZipInfo.ZipFile = "C:\ZIPDDE.ZIP"
  60.     ZipInfo.Task = 0
  61.     ZipInfo.Destination = ""
  62.     ZipInfo.FilesToZip = "C:\DOS\*.COM"
  63.     ZipInfo.KeepDate = True
  64.     ZipInfo.Overwrite = False
  65.     ZipInfo.StorePath = True
  66.     ZipInfo.Recursive = True
  67.     ZipInfo.RestorePath = True
  68.     ZipInfo.Comment = "Sample ZIP file by ZipServer"
  69.     ZipInfo.Password = "REDEI"
  70.     DDEMessage$ = ZipPass$()
  71.     Mousepointer = 11
  72.     SendDDE DDEMessage$
  73.     start& = Timer
  74.     Do
  75.        DoEvents
  76.     Loop Until (DDELabel.Caption = "-1") Or Timer - start& > 60
  77.     DDELabel.Visible = True
  78.     Mousepointer = 0
  79.     DoEvents
  80.     'To terminate the DDE server, send nothing:
  81.     MsgBox "Zip Server will be removed from memory."  'REM out to bypass it
  82.     SendDDE ""
  83.     DDELabel.LinkMode = 0' None
  84. End Sub
  85.  
  86. Sub SendDDE (DDEInstruction$)
  87.     'Send and receive DDE commands/results to/from the
  88.     'hidden DDE Zip server, using the local DDE Label control
  89.     DDELabel.Caption = UCase$(DDEInstruction$)
  90.     DDELabel.LinkPoke
  91.     DoEvents
  92.     If Not UCase$(DDEInstruction$) = "" Then     'Unload server
  93.        DDELabel.LinkRequest
  94.        If Not DDELabel.Caption = "-1" Then '"-1" successful execution
  95.           MsgBox "Zip Server's Response: " + DDELabel.Caption
  96.        End If
  97.     End If
  98. End Sub
  99.  
  100.