home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / pc / DirectX SDK / DXSDK / samples / Multimedia / VBSamples / DirectPlay / Conferencer / frmTransferReq.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2001-10-08  |  3.5 KB  |  102 lines

  1. VERSION 5.00
  2. Begin VB.Form frmTransferRequest 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Receiving a file transfer...."
  5.    ClientHeight    =   975
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   4680
  9.    ControlBox      =   0   'False
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   975
  14.    ScaleWidth      =   4680
  15.    StartUpPosition =   3  'Windows Default
  16.    Begin VB.CommandButton cmdReject 
  17.       Cancel          =   -1  'True
  18.       Caption         =   "Reject"
  19.       Height          =   315
  20.       Left            =   3420
  21.       TabIndex        =   3
  22.       Top             =   120
  23.       Width           =   1155
  24.    End
  25.    Begin VB.CommandButton cmdAccept 
  26.       Caption         =   "Accept"
  27.       Default         =   -1  'True
  28.       Height          =   315
  29.       Left            =   3420
  30.       TabIndex        =   2
  31.       Top             =   540
  32.       Width           =   1155
  33.    End
  34.    Begin VB.Label lblFriend 
  35.       BackStyle       =   0  'Transparent
  36.       Height          =   195
  37.       Left            =   720
  38.       TabIndex        =   1
  39.       Top             =   420
  40.       Width           =   2115
  41.    End
  42.    Begin VB.Label Label1 
  43.       BackStyle       =   0  'Transparent
  44.       Caption         =   "You are receiving a file transfer from"
  45.       Height          =   195
  46.       Left            =   720
  47.       TabIndex        =   0
  48.       Top             =   180
  49.       Width           =   2115
  50.    End
  51.    Begin VB.Image Image1 
  52.       Height          =   480
  53.       Left            =   120
  54.       Picture         =   "frmTransferReq.frx":0000
  55.       Top             =   180
  56.       Width           =   480
  57.    End
  58. Attribute VB_Name = "frmTransferRequest"
  59. Attribute VB_GlobalNameSpace = False
  60. Attribute VB_Creatable = False
  61. Attribute VB_PredeclaredId = True
  62. Attribute VB_Exposed = False
  63. Option Explicit
  64. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  65. '  Copyright (C) 1999-2001 Microsoft Corporation.  All Rights Reserved.
  66. '  File:       frmTransferReq.frm
  67. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  68. Private msFile As String
  69. Private mlUnique As Long
  70. Private mlPlayerID As Long
  71. Private moForm As frmNetwork
  72. Public Sub SetupRequest(oForm As frmNetwork, ByVal sPlayerName As String, ByVal sFileName As String, ByVal lUniqueID As Long, ByVal lPlayer As Long)
  73.     Set moForm = oForm
  74.     msFile = sFileName
  75.     mlUnique = lUniqueID
  76.     mlPlayerID = lPlayer
  77.     lblFriend.Caption = sPlayerName & " (" & sFileName & ")"
  78. End Sub
  79. Private Sub cmdAccept_Click()
  80.     Dim lMsg As Long, lOffset As Long
  81.     Dim oBuf() As Byte
  82.     'Accept this connection
  83.     lMsg = MsgSendFileAccept
  84.     lOffset = NewBuffer(oBuf)
  85.     AddDataToBuffer oBuf, lMsg, LenB(lMsg), lOffset
  86.     AddDataToBuffer oBuf, mlUnique, LenB(mlUnique), lOffset
  87.     dpp.SendTo mlPlayerID, oBuf, 0, DPNSEND_NOLOOPBACK
  88.     Unload Me
  89. End Sub
  90. Private Sub cmdReject_Click()
  91.     Dim lMsg As Long, lOffset As Long
  92.     Dim oBuf() As Byte
  93.     'Reject this connection
  94.     lMsg = MsgSendFileDeny
  95.     lOffset = NewBuffer(oBuf)
  96.     AddDataToBuffer oBuf, lMsg, LenB(lMsg), lOffset
  97.     AddDataToBuffer oBuf, mlUnique, LenB(mlUnique), lOffset
  98.     dpp.SendTo mlPlayerID, oBuf, 0, DPNSEND_NOLOOPBACK
  99.     moForm.EraseReceiveFile mlUnique
  100.     Unload Me
  101. End Sub
  102.