home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 November / Chip_2002-11_cd1.bin / zkuste / vbasic / Data / Utils / WME71SDK.exe / RCDATA / CABINET / BatcherInput.frm < prev    next >
Text File  |  2001-03-02  |  18KB  |  621 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  3. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  4. Object = "{C4941F47-8BC1-49D3-9989-2B7826F26AE6}#1.0#0"; "MSPShell.dll"
  5. Begin VB.Form FrmBatcherIn 
  6.    Caption         =   "Windows Media Batcher Sample"
  7.    ClientHeight    =   7995
  8.    ClientLeft      =   2010
  9.    ClientTop       =   510
  10.    ClientWidth     =   8325
  11.    Icon            =   "BatcherInput.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    ScaleHeight     =   7995
  14.    ScaleWidth      =   8325
  15.    Begin MSPROPSHELLLibCtl.MSPropShell MSPropMain 
  16.       Height          =   3015
  17.       Left            =   0
  18.       OleObjectBlob   =   "BatcherInput.frx":000C
  19.       TabIndex        =   10
  20.       Top             =   4680
  21.       Width           =   6855
  22.    End
  23.    Begin VB.CommandButton CmdExit 
  24.       Caption         =   "E&xit"
  25.       Height          =   495
  26.       Left            =   6960
  27.       TabIndex        =   8
  28.       Top             =   6240
  29.       Width           =   1335
  30.    End
  31.    Begin MSComDlg.CommonDialog DlgBat 
  32.       Left            =   7080
  33.       Top             =   3960
  34.       _ExtentX        =   847
  35.       _ExtentY        =   847
  36.       _Version        =   393216
  37.       Filter          =   "Batcher Files (*.bwm) | *.bwm"
  38.    End
  39.    Begin MSComctlLib.StatusBar StaEncoderStat 
  40.       Align           =   2  'Align Bottom
  41.       Height          =   300
  42.       Left            =   0
  43.       TabIndex        =   11
  44.       Top             =   7695
  45.       Width           =   8325
  46.       _ExtentX        =   14684
  47.       _ExtentY        =   529
  48.       Style           =   1
  49.       SimpleText      =   "Encoder Stopped"
  50.       _Version        =   393216
  51.       BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
  52.       EndProperty
  53.    End
  54.    Begin VB.CommandButton CmdStop 
  55.       Caption         =   "S&top"
  56.       Height          =   495
  57.       Left            =   6960
  58.       TabIndex        =   7
  59.       Top             =   5520
  60.       Width           =   1335
  61.    End
  62.    Begin VB.CommandButton CmdStart 
  63.       Caption         =   "&Start"
  64.       Height          =   495
  65.       Left            =   6960
  66.       TabIndex        =   6
  67.       Top             =   4800
  68.       Width           =   1335
  69.    End
  70.    Begin VB.CommandButton CmdSave 
  71.       Caption         =   "Sa&ve"
  72.       Height          =   495
  73.       Left            =   6960
  74.       TabIndex        =   5
  75.       Top             =   3120
  76.       Width           =   1335
  77.    End
  78.    Begin VB.CommandButton CmdLoad 
  79.       Caption         =   "&Load"
  80.       Height          =   495
  81.       Left            =   6960
  82.       TabIndex        =   4
  83.       Top             =   2520
  84.       Width           =   1335
  85.    End
  86.    Begin VB.CommandButton CmdClearResults 
  87.       Caption         =   "&ClearResults"
  88.       Height          =   495
  89.       Left            =   6960
  90.       TabIndex        =   3
  91.       Top             =   1920
  92.       Width           =   1335
  93.    End
  94.    Begin VB.CommandButton CmdRemoveAll 
  95.       Caption         =   "Remove&All"
  96.       Height          =   495
  97.       Left            =   6960
  98.       TabIndex        =   2
  99.       Top             =   1320
  100.       Width           =   1335
  101.    End
  102.    Begin VB.CommandButton CmdRemove 
  103.       Caption         =   "&Remove"
  104.       Height          =   495
  105.       Left            =   6960
  106.       TabIndex        =   1
  107.       Top             =   720
  108.       Width           =   1335
  109.    End
  110.    Begin VB.CommandButton CmdAdd 
  111.       Caption         =   "A&dd"
  112.       Height          =   495
  113.       Left            =   6960
  114.       TabIndex        =   0
  115.       Top             =   120
  116.       Width           =   1335
  117.    End
  118.    Begin MSComctlLib.ListView LvwBatcher 
  119.       Height          =   4455
  120.       Left            =   0
  121.       TabIndex        =   9
  122.       Top             =   120
  123.       Width           =   6855
  124.       _ExtentX        =   12091
  125.       _ExtentY        =   7858
  126.       View            =   3
  127.       LabelEdit       =   1
  128.       LabelWrap       =   -1  'True
  129.       HideSelection   =   -1  'True
  130.       _Version        =   393217
  131.       ForeColor       =   -2147483640
  132.       BackColor       =   -2147483643
  133.       BorderStyle     =   1
  134.       Appearance      =   1
  135.       NumItems        =   4
  136.       BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
  137.          Key             =   "Input"
  138.          Text            =   "Input File"
  139.          Object.Width           =   2469
  140.       EndProperty
  141.       BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
  142.          SubItemIndex    =   1
  143.          Key             =   "Output"
  144.          Text            =   "Output File"
  145.          Object.Width           =   2540
  146.       EndProperty
  147.       BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
  148.          SubItemIndex    =   2
  149.          Key             =   "Profile"
  150.          Text            =   "Profile"
  151.          Object.Width           =   2540
  152.       EndProperty
  153.       BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
  154.          SubItemIndex    =   3
  155.          Key             =   "Result"
  156.          Text            =   "Result"
  157.          Object.Width           =   2540
  158.       EndProperty
  159.    End
  160. End
  161. Attribute VB_Name = "FrmBatcherIn"
  162. Attribute VB_GlobalNameSpace = False
  163. Attribute VB_Creatable = False
  164. Attribute VB_PredeclaredId = True
  165. Attribute VB_Exposed = False
  166. Option Explicit
  167. Dim WithEvents Encoder As WMEncoder
  168. Attribute Encoder.VB_VarHelpID = -1
  169. Dim EncError As Long
  170.  
  171. Private Sub CmdAdd_Click()
  172.     Dim Profile As String
  173.     Dim InputFile As String
  174.     Dim OutputFile As String
  175.     Dim Success As Integer
  176.     
  177.     On Error GoTo Err_Handler
  178.     
  179.     FrmAddFiles.Show 1
  180.     
  181.     InputFile = FrmAddFiles.GetInputFile
  182.     If InputFile = "" Then
  183.         CmdAdd.SetFocus
  184.         Exit Sub
  185.     End If
  186.     OutputFile = FrmAddFiles.GetOutputFile
  187.     Profile = FrmAddFiles.GetProfile
  188.     
  189.     InputFile = Trim(InputFile)
  190.     OutputFile = Trim(OutputFile)
  191.     Profile = Trim(Profile)
  192.     
  193.     Success = Populate_List(InputFile, OutputFile, Profile)
  194.     If Success = 1 Then
  195.         MsgBox "Error Populating the list"
  196.     End If
  197.     CmdRemove.Enabled = True
  198.     CmdRemoveAll.Enabled = True
  199.     CmdClearResults.Enabled = True
  200.     CmdSave.Enabled = True
  201.     CmdStart.Enabled = True
  202.     
  203.     Exit Sub
  204. Err_Handler:
  205.     MsgBox "Error Adding Files", vbCritical, "Error-" & Err.Number
  206. End Sub
  207.  
  208. Private Sub CmdClearResults_Click()
  209.     Dim cnt As Integer
  210.     On Error GoTo Err_Handler
  211.     
  212.     cnt = LvwBatcher.ListItems.Count
  213.     If cnt = 0 Then
  214.         MsgBox "Nothing to clear"
  215.     End If
  216.     
  217.     
  218.     While cnt > 0
  219.         If LvwBatcher.ListItems(cnt).ListSubItems("Result") = "" Then
  220.         Else
  221.             LvwBatcher.ListItems(cnt).ListSubItems("Result") = ""
  222.         End If
  223.         cnt = cnt - 1
  224.     Wend
  225.     CmdStart.Enabled = True
  226.     Exit Sub
  227. Err_Handler:
  228.     MsgBox "Error clearing the list", vbExclamation
  229.     
  230. End Sub
  231.  
  232. Private Sub CmdExit_Click()
  233.     Set Encoder = Nothing
  234.     Unload Me
  235.     End
  236. End Sub
  237.  
  238. Private Sub CmdLoad_Click()
  239.     
  240.     
  241.     
  242.     Dim FsBat As Object
  243.     Dim InFile As String
  244.     Dim BatcherFile As Object
  245.     Dim ListIn As String
  246.     Dim InputFile As String
  247.     Dim OutputFile As String
  248.     Dim Profile As String
  249.     Dim ColonPosIn As Integer
  250.     Dim ColonPosOut As Integer
  251.     Dim ColonPosPrf As Integer
  252.     Dim LoadCnt As Integer
  253.     
  254.     On Error GoTo Err_Handler
  255.     
  256.     DlgBat.DialogTitle = "Input File"
  257.     DlgBat.Flags = cdlOFNFileMustExist
  258.     DlgBat.ShowOpen
  259.     
  260.     InFile = DlgBat.FileName
  261.     If InFile = "" Then
  262.         Exit Sub
  263.     End If
  264.     
  265.     DlgBat.FileName = ""
  266.     
  267.     Set FsBat = CreateObject("Scripting.FileSystemObject")
  268.     Set BatcherFile = FsBat.opentextfile(InFile, 1, 0)
  269.     
  270.     LvwBatcher.ListItems.Clear
  271.     LoadCnt = 1
  272.     
  273.     While BatcherFile.AtEndOfStream <> True
  274.     
  275.         ListIn = BatcherFile.readline
  276.         ColonPosIn = InStr(1, ListIn, ";")
  277.         InputFile = Mid(ListIn, 1, ColonPosIn - 1)
  278.     
  279.         ColonPosOut = InStr(ColonPosIn + 1, ListIn, ";")
  280.         OutputFile = Mid(ListIn, ColonPosIn + 1, ColonPosOut - ColonPosIn - 1)
  281.     
  282.         ColonPosPrf = InStr(ColonPosOut + 1, ListIn, ";")
  283.         Profile = Mid(ListIn, ColonPosOut + 1, ColonPosPrf - ColonPosOut - 1)
  284.     
  285.         LvwBatcher.ListItems.Add LoadCnt, , InputFile
  286.         LvwBatcher.ListItems.Item(LoadCnt).ListSubItems.Add , "OutputFile", OutputFile
  287.         LvwBatcher.ListItems.Item(LoadCnt).ListSubItems.Add , "Profile", Profile
  288.         LvwBatcher.ListItems.Item(LoadCnt).ListSubItems.Add , "Result", ""
  289.     
  290.         LoadCnt = LoadCnt + 1
  291.     Wend
  292.     BatcherFile.Close
  293.     
  294.     If LvwBatcher.ListItems.Count > 0 Then
  295.         LvwBatcher.FullRowSelect = True
  296.         Set LvwBatcher.DropHighlight = LvwBatcher.ListItems(1)
  297.         CmdRemove.Enabled = True
  298.         CmdRemoveAll.Enabled = True
  299.         CmdClearResults.Enabled = True
  300.         CmdSave.Enabled = True
  301.         CmdStart.Enabled = True
  302.         'CmdStop.Enabled = True
  303.     End If
  304.     
  305.     Exit Sub
  306.  
  307. Err_Handler:
  308.     MsgBox "Error Loading Saved Configuration", vbCritical, "Error-" & Err.Number
  309. End Sub
  310.  
  311. Private Sub CmdRemove_Click()
  312.     On Error GoTo Err_Handler
  313.     If LvwBatcher.ListItems.Count = 0 Then
  314.         Exit Sub
  315.     End If
  316.     LvwBatcher.ListItems.Remove LvwBatcher.SelectedItem.Index
  317.     Exit Sub
  318.  
  319. Err_Handler:
  320.     MsgBox "Error Removing Selected Entry From List", vbExclamation
  321.     
  322. End Sub
  323.  
  324. Private Sub CmdRemoveAll_Click()
  325.     Dim cnt As Integer
  326.     On Error GoTo Err_Handler
  327.     
  328.     cnt = LvwBatcher.ListItems.Count
  329.     While cnt > 0
  330.         LvwBatcher.ListItems.Remove cnt
  331.         cnt = cnt - 1
  332.     Wend
  333.     Exit Sub
  334. Err_Handler:
  335.     MsgBox "Error Removing Entries from List", vbExclamation
  336.     
  337. End Sub
  338.  
  339. Private Sub CmdSave_Click()
  340.     Dim ListSave As String
  341.     Dim SaveFile  As String
  342.     
  343.     Dim FsBat As Object
  344.     Dim BatcherFile As Object
  345.     
  346.     Dim SaveCnt As Integer
  347.     Dim InputFile As String
  348.     Dim OutputFile As String
  349.     Dim Profile As String
  350.     On Error GoTo Err_Handler
  351.     
  352.     
  353.     DlgBat.DialogTitle = "Save File"
  354.     DlgBat.ShowSave
  355.     SaveFile = DlgBat.FileName
  356.     DlgBat.FileName = ""
  357.     
  358.     
  359.     Set FsBat = CreateObject("Scripting.FileSystemObject")
  360.     If SaveFile = "" Then
  361.         Exit Sub
  362.     End If
  363.     
  364.     Set BatcherFile = FsBat.CreateTextFile(SaveFile, True)
  365.     
  366.     SaveCnt = 1
  367.     While SaveCnt <= LvwBatcher.ListItems.Count
  368.         InputFile = LvwBatcher.ListItems(SaveCnt)
  369.         OutputFile = LvwBatcher.ListItems(SaveCnt).ListSubItems("OutputFile")
  370.         Profile = LvwBatcher.ListItems(SaveCnt).ListSubItems("Profile")
  371.         ListSave = InputFile & ";" & OutputFile & ";" & Profile & ";"
  372.         BatcherFile.writeline (ListSave)
  373.         SaveCnt = SaveCnt + 1
  374.     Wend
  375.     BatcherFile.Close
  376.  
  377.     Exit Sub
  378. Err_Handler:
  379.     MsgBox "Error Saving List Entries", vbCritical, "Error-" & Err.Number
  380.     
  381. End Sub
  382.  
  383. Private Sub CmdStart_Click()
  384.     Dim Success As Long
  385.     Dim CntStart As Long
  386.     Dim Status As String
  387.     
  388.     Dim InputFile As String
  389.     Dim OutputFile As String
  390.     Dim Profile As String
  391.     Dim PpgMain As New WMEncMonMainPage
  392.     
  393.     Dim SrcGrpCol As IWMEncSourceGroupCollection
  394.     Dim SrcGrp As IWMEncSourceGroup
  395.     Dim ErrVal
  396.     On Error GoTo Err_Handler
  397.     
  398.     CmdStart.Enabled = False
  399.     CmdAdd.Enabled = False
  400.     CmdRemove.Enabled = False
  401.     CmdClearResults.Enabled = False
  402.     CmdRemoveAll.Enabled = False
  403.     CmdSave.Enabled = False
  404.     CmdLoad.Enabled = False
  405.     CmdStop.Enabled = True
  406.     
  407.     If LvwBatcher.ListItems.Count = 0 Then
  408.         MsgBox "No files to encode"
  409.         Exit Sub
  410.     End If
  411.     
  412.     Set Encoder = New WMEncoder
  413.     
  414.     MSPropMain.AddObject Encoder
  415.     MSPropMain.AddPage PpgMain
  416.     
  417.     Set SrcGrpCol = Encoder.SourceGroupCollection
  418.     Set SrcGrp = SrcGrpCol.Add("Batcher")
  419.     CntStart = 1
  420.     While CntStart <= LvwBatcher.ListItems.Count
  421.         InputFile = LvwBatcher.ListItems(CntStart).Text
  422.         OutputFile = LvwBatcher.ListItems(CntStart).ListSubItems("OutputFile").Text
  423.         Profile = LvwBatcher.ListItems(CntStart).ListSubItems("Profile").Text
  424.         Status = LvwBatcher.ListItems(CntStart).ListSubItems("Result").Text
  425.         
  426.         If Status <> "Done" Then
  427.             Success = ProcessInput(Encoder, InputFile, OutputFile, Profile)
  428.         
  429.             If Success = 0 Then
  430.                 LvwBatcher.ListItems(CntStart).ListSubItems("Result").Text = "Done"
  431.             Else
  432.                 ErrVal = Hex(Success)
  433.                 LvwBatcher.ListItems(CntStart).ListSubItems("Result").Text = "Error:" & ErrVal
  434.             End If
  435.         End If
  436.         CntStart = CntStart + 1
  437.         
  438.         If CntStart <= LvwBatcher.ListItems.Count Then
  439.             Set LvwBatcher.SelectedItem = LvwBatcher.ListItems(CntStart)
  440.             Set LvwBatcher.DropHighlight = LvwBatcher.ListItems(CntStart)
  441.         End If
  442.     Wend
  443.     If CntStart > LvwBatcher.ListItems.Count Then
  444.         Set Encoder = Nothing
  445.         CmdStop.Enabled = False
  446.         CmdStart.Enabled = False
  447.     End If
  448.     
  449.     CmdAdd.Enabled = True
  450.     CmdRemove.Enabled = True
  451.     CmdClearResults.Enabled = True
  452.     CmdRemoveAll.Enabled = True
  453.     CmdSave.Enabled = True
  454.     CmdLoad.Enabled = True
  455.     Exit Sub
  456.  
  457. Err_Handler:
  458.     MsgBox "Error Processing Input", vbCritical, "Error-" & Err.Number
  459. End Sub
  460.  
  461. Private Sub CmdStop_Click()
  462.     On Error GoTo Err_Handler
  463.     
  464.     If Encoder.RunState = WMENC_ENCODER_RUNNING Or WMENC_ENCODER_STARTING Or WMENC_ENCODER_PAUSED Then
  465.         Encoder.Stop
  466.     End If
  467.     Set Encoder = Nothing
  468.     
  469.     CmdAdd.Enabled = True
  470.     CmdRemove.Enabled = True
  471.     CmdRemoveAll.Enabled = True
  472.     CmdClearResults.Enabled = True
  473.     CmdLoad.Enabled = True
  474.     CmdSave.Enabled = True
  475.     CmdStart.Enabled = True
  476.     Exit Sub
  477. Err_Handler:
  478.     MsgBox "Error stopping Encoder", vbCritical, "Error-" & Err.Number
  479.     
  480. End Sub
  481.  
  482. Private Sub Encoder_OnError(ByVal hResult As Long)
  483.     EncError = Encoder.ErrorState
  484. End Sub
  485. Private Sub Form_Load()
  486.     Dim I As Integer
  487.  
  488.     
  489.     On Error GoTo Err_Handler
  490.     
  491.     For I = 1 To 4
  492.         LvwBatcher.ColumnHeaders.Item(I).Width = LvwBatcher.Width / 4
  493.     Next I
  494.     Set Encoder = Nothing
  495.     StaEncoderStat.SimpleText = "Encoder Stopped"
  496.     
  497.     CmdRemove.Enabled = False
  498.     CmdRemoveAll.Enabled = False
  499.     CmdClearResults.Enabled = False
  500.     CmdSave.Enabled = False
  501.     CmdStart.Enabled = False
  502.     CmdStop.Enabled = False
  503.     
  504.     Exit Sub
  505. Err_Handler:
  506.     MsgBox "Error Executing Application", vbCritical, "Error-" & Err.Number
  507. End Sub
  508. Function Populate_List(InputFile As String, OutputFile As String, Profile As String) As Integer
  509.     Dim SrcGrpCol As IWMEncSourceGroupCollection
  510.     Dim SrcGrp As IWMEncSourceGroup
  511.     Dim Count As Integer
  512.     
  513.     
  514.     Dim periodpos As Long
  515.     
  516.     Dim AudCnt As Integer
  517.     Dim VidCnt As Integer
  518.     
  519.     On Error GoTo Err_Handler
  520.     
  521.  
  522.     
  523.     If OutputFile = "None" Then
  524.         Set Encoder = New WMEncoder
  525.         Set SrcGrpCol = Encoder.SourceGroupCollection
  526.         Set SrcGrp = SrcGrpCol.Add("SrcList")
  527.         SrcGrp.AutoSetFileSource (InputFile)
  528.         OutputFile = InputFile
  529.         periodpos = InStrRev(InputFile, ".")
  530.         If periodpos > 0 Then OutputFile = Left(OutputFile, periodpos - 1)
  531.         
  532.         AudCnt = SrcGrp.SourceCount(WMENC_AUDIO)
  533.         VidCnt = SrcGrp.SourceCount(WMENC_VIDEO)
  534.         
  535.         If AudCnt > 0 And VidCnt = 0 Then
  536.             OutputFile = OutputFile & ".wma"
  537.         Else
  538.             OutputFile = OutputFile & ".wmv"
  539.         End If
  540.     Set Encoder = Nothing
  541.    End If
  542.  
  543.    
  544.    
  545.    Count = LvwBatcher.ListItems.Count + 1
  546.    LvwBatcher.ListItems.Add Count, , InputFile
  547.    LvwBatcher.ListItems(Count).ListSubItems.Add , "OutputFile", OutputFile
  548.    LvwBatcher.ListItems(Count).ListSubItems.Add , "Profile", Profile
  549.    LvwBatcher.ListItems(Count).ListSubItems.Add , "Result", ""
  550.    
  551.    LvwBatcher.FullRowSelect = True
  552.    Set LvwBatcher.SelectedItem = LvwBatcher.ListItems(1)
  553.    Set LvwBatcher.DropHighlight = LvwBatcher.ListItems(1)
  554.   Exit Function
  555. Err_Handler:
  556.     Populate_List = 1
  557. End Function
  558. Function ProcessInput(Encoder As WMEncoder, InputFile As String, OutputFile As String, Profile As String) As Long
  559.     
  560.     Dim SrcGrpCol As IWMEncSourceGroupCollection
  561.     Dim SrcGrp As IWMEncSourceGroup
  562.     Dim PrfCol As IWMEncProfileCollection
  563.     Dim Prf As IWMEncProfile
  564.     
  565.     Dim Success As Integer
  566.     
  567.     On Error GoTo Err_Handler
  568.     Set SrcGrpCol = Encoder.SourceGroupCollection
  569.     Set SrcGrp = SrcGrpCol.Item(0)
  570.     
  571.     SrcGrp.AutoSetFileSource (InputFile)
  572.     Set PrfCol = Encoder.ProfileCollection
  573.     Success = GetProfile(Profile, Prf, PrfCol, SrcGrp)
  574.     If Success = 1 Then
  575.         ProcessInput = 1
  576.         Exit Function
  577.     End If
  578.     Encoder.File.LocalFileName = OutputFile
  579.     EncError = 0
  580.     Encoder.Start
  581.     
  582.     
  583.     StaEncoderStat.SimpleText = "Encoder Running"
  584.     While Encoder.RunState <> WMENC_ENCODER_STOPPED And EncError = 0
  585.         DoEvents
  586.     Wend
  587.  
  588.     StaEncoderStat.SimpleText = "Encoder Stopped"
  589.     If EncError <> 0 Then
  590.         ProcessInput = EncError
  591.     End If
  592.     Exit Function
  593. Err_Handler:
  594.       ProcessInput = Err.Number
  595. End Function
  596. Function GetProfile(Profile As String, Prf As IWMEncProfile, PrfCol As IWMEncProfileCollection, SrcGrp As IWMEncSourceGroup) As Integer
  597.     Dim ExistsFlg As Boolean
  598.     On Error GoTo Err_Handler
  599.     ExistsFlg = False
  600.     
  601.     For Each Prf In PrfCol
  602.         If UCase(Prf.Name) = UCase(Profile) Then
  603.             SrcGrp.Profile = Prf
  604.             ExistsFlg = True
  605.             Exit For
  606.         End If
  607.     Next
  608.     
  609.     If ExistsFlg = False Then
  610.         GetProfile = 1
  611.     End If
  612.     Exit Function
  613. Err_Handler:
  614.      GetProfile = 1
  615. End Function
  616.  
  617. Private Sub LvwBatcher_Click()
  618.      Set LvwBatcher.DropHighlight = LvwBatcher.SelectedItem
  619.      LvwBatcher.FullRowSelect = True
  620. End Sub
  621.