Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

814 lines
26 KiB

  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 = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0"; "shdocvw.dll"
  5. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  6. Begin VB.Form frmHscSearchTester
  7. BorderStyle = 1 'Fixed Single
  8. Caption = "HSC Search Tester"
  9. ClientHeight = 9705
  10. ClientLeft = 3240
  11. ClientTop = 1215
  12. ClientWidth = 8940
  13. LinkTopic = "Form1"
  14. MaxButton = 0 'False
  15. MinButton = 0 'False
  16. ScaleHeight = 9705
  17. ScaleWidth = 8940
  18. Begin VB.CommandButton cmdClose
  19. Caption = "&Close"
  20. Height = 390
  21. Left = 7875
  22. TabIndex = 15
  23. Top = 9120
  24. Width = 1035
  25. End
  26. Begin VB.Timer Timer1
  27. Left = 3360
  28. Top = 0
  29. End
  30. Begin MSComctlLib.StatusBar StatusBar1
  31. Align = 2 'Align Bottom
  32. Height = 195
  33. Left = 0
  34. TabIndex = 2
  35. Top = 9510
  36. Width = 8940
  37. _ExtentX = 15769
  38. _ExtentY = 344
  39. _Version = 393216
  40. BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
  41. NumPanels = 1
  42. BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
  43. EndProperty
  44. EndProperty
  45. End
  46. Begin VB.Frame Frame1
  47. Height = 9150
  48. Left = 30
  49. TabIndex = 0
  50. Top = -60
  51. Width = 8880
  52. Begin TabDlg.SSTab SSTab1
  53. Height = 7830
  54. Left = 105
  55. TabIndex = 7
  56. Top = 1230
  57. Width = 8655
  58. _ExtentX = 15266
  59. _ExtentY = 13811
  60. _Version = 393216
  61. TabHeight = 520
  62. TabCaption(0) = "Basic Query Information"
  63. TabPicture(0) = "HSCSearchTester.frx":0000
  64. Tab(0).ControlEnabled= -1 'True
  65. Tab(0).Control(0)= "Label6"
  66. Tab(0).Control(0).Enabled= 0 'False
  67. Tab(0).Control(1)= "wb"
  68. Tab(0).Control(1).Enabled= 0 'False
  69. Tab(0).Control(2)= "Frame2"
  70. Tab(0).Control(2).Enabled= 0 'False
  71. Tab(0).Control(3)= "Frame3"
  72. Tab(0).Control(3).Enabled= 0 'False
  73. Tab(0).ControlCount= 4
  74. TabCaption(1) = "Advanced Query Information"
  75. TabPicture(1) = "HSCSearchTester.frx":001C
  76. Tab(1).ControlEnabled= 0 'False
  77. Tab(1).Control(0)= "Label2"
  78. Tab(1).Control(0).Enabled= 0 'False
  79. Tab(1).Control(1)= "Label1"
  80. Tab(1).Control(1).Enabled= 0 'False
  81. Tab(1).Control(2)= "txtQuery"
  82. Tab(1).Control(2).Enabled= 0 'False
  83. Tab(1).Control(3)= "cmdOpenTpl"
  84. Tab(1).Control(3).Enabled= 0 'False
  85. Tab(1).Control(4)= "txtQTpl"
  86. Tab(1).Control(4).Enabled= 0 'False
  87. Tab(1).ControlCount= 5
  88. TabCaption(2) = "Summary Results"
  89. TabPicture(2) = "HSCSearchTester.frx":0038
  90. Tab(2).ControlEnabled= 0 'False
  91. Tab(2).Control(0)= "Label11"
  92. Tab(2).Control(0).Enabled= 0 'False
  93. Tab(2).Control(1)= "Label12"
  94. Tab(2).Control(1).Enabled= 0 'False
  95. Tab(2).Control(2)= "wb2"
  96. Tab(2).Control(2).Enabled= 0 'False
  97. Tab(2).Control(3)= "lstAllMatches"
  98. Tab(2).Control(3).Enabled= 0 'False
  99. Tab(2).ControlCount= 4
  100. Begin VB.ListBox lstAllMatches
  101. Height = 2985
  102. ItemData = "HSCSearchTester.frx":0054
  103. Left = -74850
  104. List = "HSCSearchTester.frx":005B
  105. TabIndex = 31
  106. Top = 645
  107. Width = 8280
  108. End
  109. Begin VB.Frame Frame3
  110. Caption = "AutoStringified Query"
  111. Height = 2010
  112. Left = 150
  113. TabIndex = 26
  114. Top = 360
  115. Width = 8370
  116. Begin VB.TextBox txtASQ
  117. Enabled = 0 'False
  118. Height = 315
  119. Left = 105
  120. TabIndex = 29
  121. Top = 255
  122. Width = 8115
  123. End
  124. Begin VB.ListBox lstAutoStringifiableQResults
  125. Height = 1035
  126. ItemData = "HSCSearchTester.frx":006B
  127. Left = 105
  128. List = "HSCSearchTester.frx":0072
  129. TabIndex = 27
  130. Top = 855
  131. Width = 8115
  132. End
  133. Begin VB.Label lblAutoStringifiable
  134. Height = 255
  135. Left = 105
  136. TabIndex = 30
  137. Top = 240
  138. Width = 2370
  139. End
  140. Begin VB.Label Label9
  141. Caption = "AutoStringified Query Results"
  142. Height = 255
  143. Left = 105
  144. TabIndex = 28
  145. Top = 615
  146. Width = 2370
  147. End
  148. End
  149. Begin VB.Frame Frame2
  150. Caption = "Keyword Query [executed always]"
  151. Height = 2850
  152. Left = 150
  153. TabIndex = 16
  154. Top = 2385
  155. Width = 8370
  156. Begin VB.TextBox txtCanonicalQuery
  157. Enabled = 0 'False
  158. Height = 315
  159. Left = 1125
  160. TabIndex = 20
  161. Top = 540
  162. Width = 7095
  163. End
  164. Begin VB.ListBox lstStw
  165. Height = 1035
  166. Left = 105
  167. TabIndex = 19
  168. Top = 525
  169. Width = 855
  170. End
  171. Begin VB.ListBox lstSS
  172. Height = 840
  173. Left = 120
  174. TabIndex = 18
  175. Top = 1890
  176. Width = 855
  177. End
  178. Begin VB.ListBox lstMatches
  179. Height = 1620
  180. ItemData = "HSCSearchTester.frx":0082
  181. Left = 1095
  182. List = "HSCSearchTester.frx":0089
  183. TabIndex = 17
  184. Top = 1125
  185. Width = 7125
  186. End
  187. Begin VB.Label Label5
  188. Caption = "Stop Signs"
  189. Height = 255
  190. Left = 120
  191. TabIndex = 24
  192. Top = 1650
  193. Width = 855
  194. End
  195. Begin VB.Label Label4
  196. Caption = "Stop Words"
  197. Height = 255
  198. Left = 105
  199. TabIndex = 23
  200. Top = 285
  201. Width = 855
  202. End
  203. Begin VB.Label Label3
  204. Caption = "Keyword Query Results"
  205. Height = 255
  206. Left = 1095
  207. TabIndex = 22
  208. Top = 900
  209. Width = 1845
  210. End
  211. Begin VB.Label Label7
  212. Caption = "Keywords Submitted to HSC"
  213. Height = 255
  214. Left = 1095
  215. TabIndex = 21
  216. Top = 300
  217. Width = 3075
  218. End
  219. End
  220. Begin VB.TextBox txtQTpl
  221. Height = 1815
  222. Left = -74910
  223. MultiLine = -1 'True
  224. ScrollBars = 2 'Vertical
  225. TabIndex = 13
  226. Top = 825
  227. Width = 8295
  228. End
  229. Begin VB.CommandButton cmdOpenTpl
  230. Caption = "Load Template"
  231. Height = 315
  232. Left = -73590
  233. TabIndex = 12
  234. Top = 435
  235. Width = 1275
  236. End
  237. Begin VB.TextBox txtQuery
  238. Height = 2070
  239. Left = -74895
  240. MultiLine = -1 'True
  241. TabIndex = 11
  242. Top = 2970
  243. Width = 8250
  244. End
  245. Begin SHDocVwCtl.WebBrowser wb
  246. Height = 2415
  247. Left = 150
  248. TabIndex = 8
  249. Top = 5280
  250. Width = 8370
  251. ExtentX = 14764
  252. ExtentY = 4260
  253. ViewMode = 0
  254. Offline = 0
  255. Silent = 0
  256. RegisterAsBrowser= 0
  257. RegisterAsDropTarget= 1
  258. AutoArrange = 0 'False
  259. NoClientEdge = 0 'False
  260. AlignLeft = 0 'False
  261. NoWebView = 0 'False
  262. HideFileNames = 0 'False
  263. SingleClick = 0 'False
  264. SingleSelection = 0 'False
  265. NoFolders = 0 'False
  266. Transparent = 0 'False
  267. ViewID = "{0057D0E0-3573-11CF-AE69-08002B2E1262}"
  268. Location = "http:///"
  269. End
  270. Begin SHDocVwCtl.WebBrowser wb2
  271. Height = 3135
  272. Left = -74850
  273. TabIndex = 35
  274. Top = 3915
  275. Width = 8280
  276. ExtentX = 14605
  277. ExtentY = 5530
  278. ViewMode = 0
  279. Offline = 0
  280. Silent = 0
  281. RegisterAsBrowser= 0
  282. RegisterAsDropTarget= 1
  283. AutoArrange = 0 'False
  284. NoClientEdge = 0 'False
  285. AlignLeft = 0 'False
  286. NoWebView = 0 'False
  287. HideFileNames = 0 'False
  288. SingleClick = 0 'False
  289. SingleSelection = 0 'False
  290. NoFolders = 0 'False
  291. Transparent = 0 'False
  292. ViewID = "{0057D0E0-3573-11CF-AE69-08002B2E1262}"
  293. Location = "http:///"
  294. End
  295. Begin VB.Label Label12
  296. Caption = "Taxonomy Entry XML Dump"
  297. Height = 195
  298. Left = -74790
  299. TabIndex = 34
  300. Top = 3705
  301. Width = 2550
  302. End
  303. Begin VB.Label Label11
  304. Caption = "All Query Results"
  305. Height = 255
  306. Left = -74835
  307. TabIndex = 33
  308. Top = 450
  309. Width = 1845
  310. End
  311. Begin VB.Label Label6
  312. Caption = "Taxonomy Entry XML Dump"
  313. Height = 195
  314. Left = 135
  315. TabIndex = 25
  316. Top = 6015
  317. Width = 2550
  318. End
  319. Begin VB.Label Label1
  320. Caption = "Query Template"
  321. Height = 255
  322. Left = -74910
  323. TabIndex = 14
  324. Top = 495
  325. Width = 1215
  326. End
  327. Begin VB.Label Label2
  328. Caption = "Resulting XPATH Query:"
  329. Height = 255
  330. Left = -74880
  331. TabIndex = 10
  332. Top = 2715
  333. Width = 2490
  334. End
  335. End
  336. Begin VB.TextBox txtHht
  337. Height = 330
  338. Left = 135
  339. TabIndex = 6
  340. Top = 315
  341. Width = 7620
  342. End
  343. Begin VB.CommandButton cmdBrowse
  344. Caption = "..."
  345. Height = 360
  346. Left = 7800
  347. TabIndex = 5
  348. Top = 285
  349. Width = 375
  350. End
  351. Begin VB.CommandButton cmdOpen
  352. Caption = "Open"
  353. Height = 360
  354. Left = 8205
  355. TabIndex = 4
  356. Top = 285
  357. Width = 555
  358. End
  359. Begin VB.CommandButton cmdNewQuery
  360. Caption = "New Query"
  361. Height = 330
  362. Left = 7800
  363. TabIndex = 3
  364. Top = 825
  365. Width = 975
  366. End
  367. Begin VB.TextBox txtInput
  368. Enabled = 0 'False
  369. Height = 315
  370. Left = 120
  371. TabIndex = 1
  372. Top = 840
  373. Width = 7635
  374. End
  375. Begin VB.Label Label10
  376. Caption = "HHT File"
  377. Height = 255
  378. Left = 135
  379. TabIndex = 32
  380. Top = 120
  381. Width = 3075
  382. End
  383. Begin VB.Label Label8
  384. Caption = "User Typed Query"
  385. Height = 255
  386. Left = 120
  387. TabIndex = 9
  388. Top = 645
  389. Width = 3075
  390. End
  391. End
  392. Begin MSComDlg.CommonDialog CommonDialog1
  393. Left = 7350
  394. Top = 9150
  395. _ExtentX = 847
  396. _ExtentY = 847
  397. _Version = 393216
  398. End
  399. End
  400. Attribute VB_Name = "frmHscSearchTester"
  401. Attribute VB_GlobalNameSpace = False
  402. Attribute VB_Creatable = False
  403. Attribute VB_PredeclaredId = True
  404. Attribute VB_Exposed = False
  405. Option Explicit
  406. Private WithEvents m_HssQt As HssSimSearch
  407. Attribute m_HssQt.VB_VarHelpID = -1
  408. Private m_dblTimeLastKey As Double
  409. Private m_strHht As String ' The Hht File used as base.
  410. Private m_strTempXMLFile As String ' Temporary File for XML Rendering
  411. Private m_bBatchMode As Boolean ' Tells parts of the app whether
  412. ' we are running Batch or interactive
  413. Private Function GetFile(ByVal strURI As String) As String
  414. GetFile = ""
  415. Dim oFs As Scripting.FileSystemObject: Set oFs = New FileSystemObject
  416. Dim oTs As TextStream: Set oTs = oFs.OpenTextFile(strURI)
  417. GetFile = oTs.ReadAll
  418. End Function
  419. Private Sub cmdBrowse_Click()
  420. CommonDialog1.ShowOpen
  421. txtHht.Text = CommonDialog1.FileName
  422. End Sub
  423. Private Sub cmdClose_Click()
  424. Unload Me
  425. End Sub
  426. Private Sub cmdNewQuery_Click()
  427. Me.txtInput = ""
  428. End Sub
  429. Private Sub cmdOpenTpl_Click()
  430. CommonDialog1.ShowOpen
  431. If (Len(CommonDialog1.FileName) > 0) Then
  432. Me.txtQTpl.Text = GetFile(CommonDialog1.FileName)
  433. m_HssQt.XpathQueryTplXml = txtQTpl
  434. ProcessQuery
  435. End If
  436. End Sub
  437. Private Sub cmdOpen_Click()
  438. ' OpenHht CommonDialog1.FileName
  439. m_HssQt.TestedHht = CommonDialog1.FileName
  440. Me.Frame1.Enabled = True
  441. Me.txtInput.Enabled = True
  442. Me.cmdOpenTpl.Enabled = True
  443. Common_Exit:
  444. End Sub
  445. Private Sub Form_Load()
  446. Set m_HssQt = New HssSimSearch
  447. m_HssQt.Init
  448. ' Initialize the XPath Query Generator
  449. txtQTpl = GetFile(App.Path + "\HSCQuery_Exact_Match.xml")
  450. m_HssQt.XpathQueryTplXml = txtQTpl
  451. ' Let's Get a Temporary File Name
  452. Dim oFs As Scripting.FileSystemObject: Set oFs = New Scripting.FileSystemObject
  453. m_strTempXMLFile = Environ$("TEMP") + "\" + oFs.GetTempName + ".xml"
  454. Dim oFh As Scripting.TextStream
  455. Set oFh = oFs.CreateTextFile(m_strTempXMLFile)
  456. oFh.WriteLine "<Note>When you click on a Match, the Taxonomy Entry will show up here</Note>"
  457. oFh.Close
  458. wb.Navigate m_strTempXMLFile
  459. StatusBar1.Style = sbrSimple
  460. Me.AutoRedraw = False
  461. ' == Disable all controls which should not have User Input
  462. Me.cmdOpenTpl.Enabled = False
  463. If (Len(Command$) > 0) Then
  464. doWork Command$
  465. Unload Me
  466. Else
  467. Timer1.Interval = 400
  468. End If
  469. End Sub
  470. Private Sub Form_Terminate()
  471. Dim oFs As Scripting.FileSystemObject: Set oFs = New Scripting.FileSystemObject
  472. If oFs.FileExists(m_strTempXMLFile) Then oFs.DeleteFile m_strTempXMLFile
  473. End Sub
  474. Private Sub lstAllMatches_Click()
  475. DisplayTaxonomyEntry lstAllMatches, m_HssQt.MergedResults, wb2
  476. End Sub
  477. Private Sub lstAutoStringifiableQResults_Click()
  478. DisplayTaxonomyEntry lstAutoStringifiableQResults, m_HssQt.AutoStringResults, wb
  479. End Sub
  480. Private Sub lstMatches_Click()
  481. DisplayTaxonomyEntry lstMatches, m_HssQt.KwQResults, wb
  482. End Sub
  483. Sub DisplayTaxonomyEntry(oList As ListBox, oResultsList As IXMLDOMNodeList, wBrowser As WebBrowser)
  484. If (oList.ListIndex < oResultsList.length) Then
  485. Dim oDom As DOMDocument: Set oDom = New DOMDocument
  486. oDom.loadXML oResultsList.Item(oList.ListIndex).xml
  487. oDom.save m_strTempXMLFile
  488. wBrowser.Navigate m_strTempXMLFile
  489. End If
  490. End Sub
  491. Private Sub m_HssQt_QueryComplete(bCancel As Variant)
  492. Debug.Print "Here"
  493. ' Now let's show everything we've gathered on the UI
  494. If (m_HssQt.QueryIsAutoStringifiable) Then
  495. Me.lblAutoStringifiable = "[ Query is AutoStringifiable ]"
  496. Else
  497. Me.lblAutoStringifiable = "[ Query is NOT AutoStringifiable ]"
  498. End If
  499. Me.txtASQ = m_HssQt.AutoStringyQuery
  500. Me.txtCanonicalQuery = m_HssQt.CanonicalQuery
  501. ' Populate the Resulting Stopwords and StopSigns Lists
  502. lstStw.Clear
  503. Dim strKey As Variant
  504. For Each strKey In m_HssQt.StopWords.Keys ' m_odStw.Keys
  505. lstStw.AddItem strKey
  506. Next
  507. lstSS.Clear
  508. For Each strKey In m_HssQt.StopSigns.Keys ' m_odSs.Keys
  509. lstSS.AddItem strKey
  510. Next
  511. DoEvents
  512. ' BUGBUG: Need to add stats for AutoString Query.
  513. If (Not m_HssQt.KwQResults Is Nothing) Then
  514. StatusBar1.SimpleText = "Time: " & _
  515. Format(m_HssQt.QueryTiming, "##0.000000") & _
  516. " Records = " & m_HssQt.KwQResults.length
  517. End If
  518. ' BUGBUG: Need to prop back from Query Object the Query Errors.
  519. Dim bKwqError As Boolean, bAsqError As Boolean
  520. bKwqError = False: bAsqError = False
  521. DisplayResultsList m_HssQt.AutoStringResults, Me.lstAutoStringifiableQResults, bAsqError
  522. DisplayResultsList m_HssQt.KwQResults, lstMatches, bKwqError
  523. DisplayResultsList m_HssQt.MergedResults, Me.lstAllMatches, False
  524. End Sub
  525. Private Sub Timer1_Timer()
  526. Static s_strPrevInput As String
  527. Static s_bqueryInProgress As Boolean
  528. If (Len(Me.txtInput) > 0) Then
  529. If (Timer - m_dblTimeLastKey > 0.2) Then
  530. If (Me.txtInput <> s_strPrevInput) Then
  531. If (Not s_bqueryInProgress) Then
  532. s_bqueryInProgress = True
  533. s_strPrevInput = Me.txtInput
  534. ProcessQuery
  535. s_bqueryInProgress = False
  536. End If
  537. End If
  538. End If
  539. End If
  540. End Sub
  541. Private Sub txtInput_Change()
  542. ' Debug.Print "txtInput_Change: Query = " & txtInput.Text
  543. m_dblTimeLastKey = Timer
  544. End Sub
  545. Sub ProcessQuery()
  546. m_HssQt.ProcessQuery Me.txtInput
  547. Common_Exit:
  548. Exit Sub
  549. End Sub
  550. Sub DisplayResultsList(oDomList As IXMLDOMNodeList, oListBox As ListBox, bError As Boolean)
  551. Dim i As Long
  552. oListBox.Clear
  553. If (Not oDomList Is Nothing) Then
  554. If oDomList.length = 0 Then oListBox.AddItem "No matching elements"
  555. For i = 0 To oDomList.length - 1
  556. oListBox.AddItem "[" + CStr(i + 1) + "]" + oDomList.Item(i).Attributes.getNamedItem("TITLE").Text
  557. Next
  558. Else
  559. oListBox.AddItem "No matching elements - N"
  560. End If
  561. End Sub
  562. ' ================ Batch Procssing Routines ======================
  563. ' ============= Command Line Interface ====================
  564. ' Function: Parseopts
  565. ' Objective : Supplies a Command Line arguments interface parsing
  566. Function ParseOpts(ByVal strCmd As String) As Boolean
  567. ' Dim strErrMsg As String: strErrMsg = "": If (g_bOnErrorHandling) Then On Error GoTo Error_Handler
  568. Dim lProgOpt As Long
  569. Dim iError As Long
  570. Dim lFileCounter As Long: lFileCounter = 0
  571. Const INP_FILE1 As Long = 2 ^ 0
  572. Const INP_FILE2 As Long = 2 ^ 1
  573. ' Const OPT_SSDB As Long = 2 ^ 0
  574. Dim strArg As String
  575. Do While (Len(strCmd) > 0 And iError = 0)
  576. strCmd = Trim$(strCmd)
  577. If Left$(strCmd, 1) = Chr(34) Then
  578. strCmd = Right$(strCmd, Len(strCmd) - 1)
  579. strArg = vntGetTok(strCmd, sTokSepIN:=Chr(34))
  580. Else
  581. strArg = vntGetTok(strCmd, sTokSepIN:=" ")
  582. End If
  583. If (Left$(strArg, 1) = "/" Or Left$(strArg, 1) = "-") Then
  584. ' strArg = Mid$(strArg, 2)
  585. '
  586. ' Select Case UCase$(strArg)
  587. ' ' All the Cases are in alphabetical order to make your life
  588. ' ' easier to go through them. There are a couple of exceptions.
  589. ' ' The first one is that every NOXXX option goes after the
  590. ' ' pairing OPTION.
  591. ' Case "EXPANDONLY"
  592. ' lProgOpt = (lProgOpt Or OPT_EXPANDONLY)
  593. ' Me.chkExpandOnly = vbChecked
  594. '
  595. '
  596. ' Case "INC"
  597. ' lProgOpt = (lProgOpt Or OPT_INC)
  598. ' Me.chkInc = vbChecked
  599. '
  600. ' Case "SSDB"
  601. ' strArg = LCase$(vntGetTok(strCmd, sTokSepIN:=" "))
  602. ' If ("\\" = Left$(strArg, 2)) Then
  603. ' lProgOpt = lProgOpt Or OPT_SSDB
  604. ' Me.txtSSDB = strArg
  605. ' Else
  606. ' MsgBox ("A source safe database must be specified using UNC '\\' style notation")
  607. ' iError = 1
  608. ' End If
  609. '
  610. ' Case "SSPROJ"
  611. ' strArg = LCase$(vntGetTok(strCmd, sTokSepIN:=" "))
  612. ' If ("$/" = Left$(strArg, 2)) Then
  613. ' lProgOpt = lProgOpt Or OPT_SSPROJ
  614. ' Me.txtSSProject = strArg
  615. ' Else
  616. ' MsgBox ("A source safe project must be specified using '$/' style notation")
  617. ' iError = 1
  618. ' End If
  619. '
  620. ' Case "LVIDIR"
  621. ' strArg = LCase$(vntGetTok(strCmd, sTokSepIN:=" "))
  622. ' If ("\\" = Left$(strArg, 2)) Then
  623. ' lProgOpt = lProgOpt Or OPT_LVIDIR
  624. ' Me.txtLiveImageDir = strArg
  625. ' Else
  626. ' MsgBox ("Live Image Directory must be specified using UNC '\\' style notation")
  627. ' iError = 1
  628. ' End If
  629. '
  630. ' Case "WORKDIR"
  631. ' strArg = LCase$(vntGetTok(strCmd, sTokSepIN:=" "))
  632. ' If ("\\" = Left$(strArg, 2)) Then
  633. ' lProgOpt = lProgOpt Or OPT_WORKDIR
  634. ' Me.txtWorkDir = strArg
  635. ' Else
  636. ' MsgBox ("Working Directory must be specified using UNC '\\' style notation")
  637. ' iError = 1
  638. ' End If
  639. '
  640. ' Case "RENLIST"
  641. ' strArg = vntGetTok(strCmd, sTokSepIN:=" ")
  642. ' If (Not (FileExists(strArg))) Then
  643. ' MsgBox ("Cannot open Renames file " & strArg & ". Make sure you type a Full Pathname")
  644. ' iError = 1
  645. ' lProgOpt = (lProgOpt And (Not OPT_RENLIST))
  646. ' Else
  647. ' Me.txtRenamesFile = strArg
  648. ' lProgOpt = (lProgOpt Or OPT_RENLIST)
  649. ' End If
  650. '
  651. '
  652. ' Case Else
  653. ' MsgBox "Program Option: " & "/" & strArg & " is not supported", vbOKOnly, "Program Arguments Error"
  654. ' lProgOpt = 0
  655. ' iError = 1
  656. '
  657. ' End Select
  658. Else
  659. lFileCounter = lFileCounter + 1
  660. ' strArg = vntGetTok(strCmd, sTokSepIN:=" ")
  661. If (Not (FileExists(strArg))) Then
  662. MsgBox ("Cannot open input file " & strArg & ". Make sure you type a Full Pathname")
  663. iError = 1
  664. Select Case lFileCounter
  665. Case 1
  666. lProgOpt = (lProgOpt And (Not INP_FILE1))
  667. Case 2
  668. lProgOpt = (lProgOpt And (Not INP_FILE2))
  669. End Select
  670. Else
  671. Select Case lFileCounter
  672. Case 1
  673. ' m_strInputBatch = Rel2AbsPathName(strArg)
  674. m_HssQt.TestBatch = Rel2AbsPathName(strArg)
  675. lProgOpt = (lProgOpt Or INP_FILE1)
  676. Case 2
  677. ' Me.txtHht = Rel2AbsPathName(strArg)
  678. m_HssQt.TestedHht = Rel2AbsPathName(strArg)
  679. Me.txtHht = m_HssQt.TestedHht
  680. lProgOpt = (lProgOpt Or INP_FILE2)
  681. End Select
  682. End If
  683. End If
  684. Loop
  685. ' Now we check for a complete and <coherent> list of files / options.
  686. ' As all options are
  687. ' mandatory then we check for ALL options being set.
  688. If ((lProgOpt And (INP_FILE1 Or INP_FILE2)) <> (INP_FILE1 Or INP_FILE2)) Then
  689. UseageMsg
  690. iError = 1
  691. End If
  692. ParseOpts = (0 = iError)
  693. Exit Function
  694. 'Error_Handler:
  695. ' g_XErr.SetInfo "frmLiveHelpFileImage::ParseOpts", strErrMsg
  696. ' Err.Raise Err.Number
  697. End Function
  698. Sub doWork(ByVal strCmd As String)
  699. ' Dim strErrMsg As String: strErrMsg = "": If (g_bOnErrorHandling) Then On Error GoTo Error_Handler
  700. If Not ParseOpts(strCmd) Then
  701. GoTo Common_Exit
  702. End If
  703. Me.Show vbModeless
  704. m_HssQt.ProcessBatch
  705. Common_Exit:
  706. Exit Sub
  707. 'Error_Handler:
  708. '
  709. ' g_XErr.SetInfo "frmLiveHelpFileImage::doWork", strErrMsg
  710. ' Err.Raise Err.Number
  711. '
  712. End Sub
  713. Sub UseageMsg()
  714. MsgBox "HSCSearchTester TestFile.xml HHTFile", _
  715. vbOKOnly, "HSCSearchTester Program Usage"
  716. End Sub