Leaked source code of windows server 2003
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.

961 lines
29 KiB

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  4. Begin VB.Form frmImporter
  5. Caption = "Importer"
  6. ClientHeight = 8955
  7. ClientLeft = 105
  8. ClientTop = 390
  9. ClientWidth = 7710
  10. LinkTopic = "Form1"
  11. ScaleHeight = 8955
  12. ScaleWidth = 7710
  13. Begin VB.Frame fraHelp
  14. Caption = "Help file directory"
  15. Height = 1575
  16. Left = 120
  17. TabIndex = 16
  18. Top = 7320
  19. Width = 4935
  20. Begin VB.OptionButton optHelp
  21. Caption = "%windir%\help (using hcp://)"
  22. Height = 255
  23. Index = 1
  24. Left = 120
  25. TabIndex = 22
  26. Top = 480
  27. Width = 2415
  28. End
  29. Begin VB.TextBox txtSubDir
  30. Height = 285
  31. Left = 1200
  32. TabIndex = 21
  33. Tag = "1"
  34. Top = 1200
  35. Width = 3615
  36. End
  37. Begin VB.OptionButton optHelp
  38. Caption = "%windir%\pchealth\helpctr\vendors\<vendor>"
  39. Height = 255
  40. Index = 3
  41. Left = 120
  42. TabIndex = 19
  43. Top = 960
  44. Width = 3615
  45. End
  46. Begin VB.OptionButton optHelp
  47. Caption = "%windir%\pchealth\helpctr\system"
  48. Height = 255
  49. Index = 2
  50. Left = 120
  51. TabIndex = 18
  52. Top = 720
  53. Width = 2775
  54. End
  55. Begin VB.OptionButton optHelp
  56. Caption = "%windir%\help (using MS-ITS)"
  57. Height = 255
  58. Index = 0
  59. Left = 120
  60. TabIndex = 17
  61. Top = 240
  62. Width = 2415
  63. End
  64. Begin VB.Label lblSubDir
  65. Caption = "Sub directory:"
  66. Height = 255
  67. Left = 120
  68. TabIndex = 20
  69. Top = 1200
  70. Width = 975
  71. End
  72. End
  73. Begin VB.Frame fraSKU
  74. Caption = "SKU"
  75. Height = 1575
  76. Left = 120
  77. TabIndex = 4
  78. Top = 5640
  79. Width = 4935
  80. Begin VB.CheckBox chkSKU
  81. Caption = "32-bit P&ersonal"
  82. Height = 255
  83. Index = 1
  84. Left = 120
  85. TabIndex = 6
  86. Top = 480
  87. Width = 2055
  88. End
  89. Begin VB.CheckBox chkSKU
  90. Caption = "32-bit &Professional"
  91. Height = 255
  92. Index = 2
  93. Left = 120
  94. TabIndex = 7
  95. Top = 720
  96. Width = 2055
  97. End
  98. Begin VB.CheckBox chkSKU
  99. Caption = "32-bit &Server"
  100. Height = 255
  101. Index = 4
  102. Left = 2640
  103. TabIndex = 9
  104. Top = 240
  105. Width = 2055
  106. End
  107. Begin VB.CheckBox chkSKU
  108. Caption = "32-bit &Advanced Server"
  109. Height = 255
  110. Index = 5
  111. Left = 2640
  112. TabIndex = 10
  113. Top = 480
  114. Width = 2055
  115. End
  116. Begin VB.CheckBox chkSKU
  117. Caption = "32-bit Data&center Server"
  118. Height = 255
  119. Index = 7
  120. Left = 2640
  121. TabIndex = 12
  122. Top = 960
  123. Width = 2055
  124. End
  125. Begin VB.CheckBox chkSKU
  126. Caption = "64-bit Pro&fessional"
  127. Height = 255
  128. Index = 3
  129. Left = 120
  130. TabIndex = 8
  131. Top = 960
  132. Width = 2055
  133. End
  134. Begin VB.CheckBox chkSKU
  135. Caption = "64-bit Ad&vanced Server"
  136. Height = 255
  137. Index = 6
  138. Left = 2640
  139. TabIndex = 11
  140. Top = 720
  141. Width = 2055
  142. End
  143. Begin VB.CheckBox chkSKU
  144. Caption = "64-bit Datac&enter Server"
  145. Height = 255
  146. Index = 8
  147. Left = 2640
  148. TabIndex = 13
  149. Top = 1200
  150. Width = 2055
  151. End
  152. Begin VB.CheckBox chkSKU
  153. Caption = "Windows &Me"
  154. Height = 255
  155. Index = 0
  156. Left = 120
  157. TabIndex = 5
  158. Top = 240
  159. Width = 2055
  160. End
  161. End
  162. Begin VB.CommandButton cmdClose
  163. Caption = "Close"
  164. Height = 375
  165. Left = 6360
  166. TabIndex = 14
  167. Top = 8520
  168. Width = 1215
  169. End
  170. Begin TabDlg.SSTab SSTab
  171. Height = 5415
  172. Left = 120
  173. TabIndex = 0
  174. Top = 120
  175. Width = 7485
  176. _ExtentX = 13203
  177. _ExtentY = 9551
  178. _Version = 393216
  179. Tabs = 4
  180. TabsPerRow = 4
  181. TabHeight = 520
  182. TabCaption(0) = "Table of Contents"
  183. TabPicture(0) = "frmImporter.frx":0000
  184. Tab(0).ControlEnabled= -1 'True
  185. Tab(0).Control(0)= "tre(0)"
  186. Tab(0).Control(0).Enabled= 0 'False
  187. Tab(0).Control(1)= "ilsIcons"
  188. Tab(0).Control(1).Enabled= 0 'False
  189. Tab(0).ControlCount= 2
  190. TabCaption(1) = "Index"
  191. TabPicture(1) = "frmImporter.frx":001C
  192. Tab(1).ControlEnabled= 0 'False
  193. Tab(1).Control(0)= "tre(1)"
  194. Tab(1).ControlCount= 1
  195. TabCaption(2) = "HTM"
  196. TabPicture(2) = "frmImporter.frx":0038
  197. Tab(2).ControlEnabled= 0 'False
  198. Tab(2).Control(0)= "tre(2)"
  199. Tab(2).ControlCount= 1
  200. TabCaption(3) = "Spreadsheet"
  201. TabPicture(3) = "frmImporter.frx":0054
  202. Tab(3).ControlEnabled= 0 'False
  203. Tab(3).Control(0)= "tre(3)"
  204. Tab(3).ControlCount= 1
  205. Begin MSComctlLib.TreeView tre
  206. Height = 4575
  207. Index = 2
  208. Left = -74880
  209. TabIndex = 3
  210. Tag = "1"
  211. Top = 720
  212. Width = 7215
  213. _ExtentX = 12726
  214. _ExtentY = 8070
  215. _Version = 393217
  216. Indentation = 529
  217. Style = 7
  218. Appearance = 1
  219. OLEDropMode = 1
  220. End
  221. Begin MSComctlLib.TreeView tre
  222. Height = 4575
  223. Index = 1
  224. Left = -74880
  225. TabIndex = 2
  226. Tag = "1"
  227. Top = 720
  228. Width = 7215
  229. _ExtentX = 12726
  230. _ExtentY = 8070
  231. _Version = 393217
  232. Indentation = 529
  233. Style = 7
  234. Appearance = 1
  235. OLEDropMode = 1
  236. End
  237. Begin MSComctlLib.ImageList ilsIcons
  238. Left = 6720
  239. Top = 4920
  240. _ExtentX = 1005
  241. _ExtentY = 1005
  242. BackColor = -2147483643
  243. ImageWidth = 16
  244. ImageHeight = 16
  245. MaskColor = 16776960
  246. _Version = 393216
  247. BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
  248. NumListImages = 4
  249. BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
  250. Picture = "frmImporter.frx":0070
  251. Key = ""
  252. EndProperty
  253. BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
  254. Picture = "frmImporter.frx":0182
  255. Key = ""
  256. EndProperty
  257. BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
  258. Picture = "frmImporter.frx":0294
  259. Key = ""
  260. EndProperty
  261. BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
  262. Picture = "frmImporter.frx":03A6
  263. Key = ""
  264. EndProperty
  265. EndProperty
  266. End
  267. Begin MSComctlLib.TreeView tre
  268. Height = 4575
  269. Index = 0
  270. Left = 120
  271. TabIndex = 1
  272. Tag = "1"
  273. Top = 720
  274. Width = 7215
  275. _ExtentX = 12726
  276. _ExtentY = 8070
  277. _Version = 393217
  278. Indentation = 529
  279. Style = 7
  280. Appearance = 1
  281. OLEDropMode = 1
  282. End
  283. Begin MSComctlLib.TreeView tre
  284. Height = 4575
  285. Index = 3
  286. Left = -74880
  287. TabIndex = 15
  288. Tag = "1"
  289. Top = 720
  290. Width = 7215
  291. _ExtentX = 12726
  292. _ExtentY = 8070
  293. _Version = 393217
  294. Indentation = 529
  295. Style = 7
  296. Appearance = 1
  297. OLEDropMode = 1
  298. End
  299. End
  300. End
  301. Attribute VB_Name = "frmImporter"
  302. Attribute VB_GlobalNameSpace = False
  303. Attribute VB_Creatable = False
  304. Attribute VB_PredeclaredId = True
  305. Attribute VB_Exposed = False
  306. Option Explicit
  307. Private WithEvents p_clsImporter As AuthDatabase.Importer
  308. Attribute p_clsImporter.VB_VarHelpID = -1
  309. Private p_dictURIs As Scripting.Dictionary
  310. Private p_clsSizer As Sizer
  311. Private p_strMissingFiles As String
  312. Private p_strCorruptFiles As String
  313. Private Const ROOT_KEY_C As String = "Root"
  314. Private Enum IMAGE_E
  315. IMAGE_LEAF_E = 1
  316. IMAGE_GROUP_E = 2
  317. IMAGE_BAD_LEAF_E = 3
  318. IMAGE_BAD_GROUP_E = 4
  319. End Enum
  320. Private Enum TREEVIEW_INDEX_E
  321. TI_HHC_E = 0
  322. TI_HHK_E = 1
  323. TI_HTM_E = 2
  324. TI_XLS_E = 3
  325. End Enum
  326. Private Enum HELPDIR_INDEX_E
  327. HDI_HELP_MSITS_E = 0
  328. HDI_HELP_HCP_E = 1
  329. HDI_SYSTEM_E = 2
  330. HDI_VENDOR_E = 3
  331. End Enum
  332. Private Const MAX_TREEVIEW_INDEX_C As Long = 3
  333. Private Enum SKU_INDEX_E
  334. SI_WINDOWS_MILLENNIUM_E = 0
  335. SI_STANDARD_E = 1
  336. SI_PROFESSIONAL_E = 2
  337. SI_PROFESSIONAL_64_E = 3
  338. SI_SERVER_E = 4
  339. SI_ADVANCED_SERVER_E = 5
  340. SI_ADVANCED_SERVER_64_E = 6
  341. SI_DATA_CENTER_SERVER_E = 7
  342. SI_DATA_CENTER_SERVER_64_E = 8
  343. End Enum
  344. Private Sub Form_Load()
  345. On Error GoTo LErrorHandler
  346. Dim Node As Node
  347. Dim HHKDomDoc As MSXML2.DOMDocument
  348. Dim HHKDomNode As MSXML2.IXMLDOMNode
  349. Dim Element As MSXML2.IXMLDOMElement
  350. Dim intIndex As Long
  351. Dim clsTaxonomy As AuthDatabase.Taxonomy
  352. Set p_clsImporter = g_AuthDatabase.Importer
  353. Set p_dictURIs = New Scripting.Dictionary
  354. p_dictURIs.CompareMode = TextCompare
  355. Set p_clsSizer = New Sizer
  356. cmdClose.Cancel = True
  357. optHelp(HDI_HELP_MSITS_E).Value = True
  358. For intIndex = 0 To MAX_TREEVIEW_INDEX_C
  359. tre(intIndex).LabelEdit = tvwManual
  360. tre(intIndex).HideSelection = False
  361. Set tre(intIndex).ImageList = ilsIcons
  362. Set Node = tre(intIndex).Nodes.Add(Key:=ROOT_KEY_C, Text:=ROOT_KEY_C)
  363. Node.Expanded = True
  364. Node.Image = IMAGE_GROUP_E
  365. Next
  366. Set HHKDomDoc = New MSXML2.DOMDocument
  367. Set Element = HHKDomDoc.createElement(HHT_TAXONOMY_ENTRIES_C)
  368. Set HHKDomNode = HHKDomDoc.appendChild(Element)
  369. Set tre(TI_HHK_E).Nodes(ROOT_KEY_C).Tag = HHKDomNode
  370. Set clsTaxonomy = g_AuthDatabase.Taxonomy
  371. clsTaxonomy.GetURIs p_dictURIs
  372. p_SetToolTips
  373. SetFontInternal Me
  374. LEnd:
  375. Exit Sub
  376. LErrorHandler:
  377. g_ErrorInfo.SetInfoAndDump "Form_Load"
  378. GoTo LEnd
  379. End Sub
  380. Private Sub Form_Unload(Cancel As Integer)
  381. Set p_clsImporter = Nothing
  382. Set p_dictURIs = Nothing
  383. Set p_clsSizer = Nothing
  384. Set frmImporter = Nothing
  385. End Sub
  386. Private Sub Form_Activate()
  387. On Error GoTo LErrorHandler
  388. p_SetSizingInfo
  389. Exit Sub
  390. LErrorHandler:
  391. g_ErrorInfo.SetInfoAndDump "Form_Activate"
  392. End Sub
  393. Private Sub Form_Resize()
  394. On Error GoTo LErrorHandler
  395. p_clsSizer.Resize
  396. Exit Sub
  397. LErrorHandler:
  398. g_ErrorInfo.SetInfoAndDump "Form_Resize"
  399. End Sub
  400. Private Sub p_clsImporter_CorruptFile(ByVal strFileName As String)
  401. p_strCorruptFiles = p_strCorruptFiles & strFileName & " "
  402. End Sub
  403. Private Sub p_clsImporter_MissingFile(ByVal strFileName As String)
  404. p_strMissingFiles = p_strMissingFiles & strFileName & " "
  405. End Sub
  406. Private Sub tre_OLEDragDrop(Index As Integer, Data As MSComctlLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single)
  407. On Error GoTo LErrorHandler
  408. Dim vntFileName As Variant
  409. If (Data.GetFormat(vbCFFiles)) Then
  410. For Each vntFileName In Data.Files
  411. AddFile vntFileName
  412. Next
  413. End If
  414. LEnd:
  415. Exit Sub
  416. LErrorHandler:
  417. g_ErrorInfo.SetInfoAndDump "tre_OLEDragDrop"
  418. GoTo LEnd
  419. End Sub
  420. Private Sub tre_OLEDragOver(Index As Integer, Data As MSComctlLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single, State As Integer)
  421. On Error GoTo LErrorHandler
  422. Dim vntPathName As Variant
  423. Dim strExtension As String
  424. Effect = vbDropEffectNone
  425. If (Data.GetFormat(vbCFFiles)) Then
  426. For Each vntPathName In Data.Files
  427. strExtension = UCase$(FileExtension(vntPathName))
  428. Select Case strExtension
  429. Case FILE_EXT_HHC_C, FILE_EXT_HHK_C, FILE_EXT_XLS_C, FILE_EXT_CHM_C, _
  430. FILE_EXT_HTM_C
  431. Effect = vbDropEffectCopy
  432. End Select
  433. Next
  434. End If
  435. LEnd:
  436. Exit Sub
  437. LErrorHandler:
  438. g_ErrorInfo.SetInfoAndDump "tre_OLEDragOver"
  439. GoTo LEnd
  440. End Sub
  441. Private Sub tre_MouseDown(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
  442. tre(Index).SelectedItem = tre(Index).HitTest(x, y)
  443. End Sub
  444. Private Sub tre_MouseMove(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
  445. Dim Node As Node
  446. Dim blnHHK As Boolean
  447. If Button = vbLeftButton Then
  448. If (Not tre(Index).SelectedItem Is Nothing) Then
  449. Set Node = tre(Index).SelectedItem
  450. If (IsObject(Node.Tag)) Then
  451. If (GetSelectedSKUs() = 0) Then
  452. MsgBox "Please select appropriate SKUs before dragging", vbOKOnly
  453. Exit Sub
  454. End If
  455. tre(Index).DragIcon = Node.CreateDragImage
  456. tre(Index).Drag vbBeginDrag
  457. blnHHK = IIf((Index = TI_HHK_E), True, False)
  458. frmMain.BeginDrag Node.Tag, blnHHK
  459. End If
  460. End If
  461. End If
  462. End Sub
  463. Private Sub cmdClose_Click()
  464. Unload Me
  465. End Sub
  466. Public Sub AddFile( _
  467. ByVal i_strPathName As String, _
  468. Optional ByVal i_strBase As String = "" _
  469. )
  470. On Error GoTo LErrorHandler
  471. Dim strExtension As String
  472. Dim strFileName As String
  473. Dim vntFile As Variant
  474. Dim DOMDoc As MSXML2.IXMLDOMDocument
  475. Dim DOMNode As MSXML2.IXMLDOMNode
  476. Dim Element As MSXML2.IXMLDOMElement
  477. Dim Node As Node
  478. Dim FSO As Scripting.FileSystemObject
  479. Dim WS As IWshShell
  480. Dim strChmDir As String
  481. Dim strBaseDir As String
  482. Dim strCmd As String
  483. Dim strParentNode As String
  484. Dim strHTMLocation As String
  485. Dim enumHelpDir As HELPDIR_E
  486. Dim strSubDir As String
  487. Me.MousePointer = vbHourglass
  488. strExtension = UCase$(FileExtension(i_strPathName))
  489. strFileName = FileNameFromPath(i_strPathName)
  490. enumHelpDir = p_GetHelpDir
  491. strSubDir = Trim$(txtSubDir)
  492. p_clsImporter.SetHelpDir enumHelpDir, strSubDir
  493. Set FSO = New Scripting.FileSystemObject
  494. Select Case strExtension
  495. Case FILE_EXT_HHC_C
  496. If (p_NodeExists(TI_HHC_E, strFileName)) Then
  497. GoTo LEnd
  498. End If
  499. p_strMissingFiles = ""
  500. p_strCorruptFiles = ""
  501. If (i_strBase = "") Then
  502. strHTMLocation = InputBox("For importing HHCs, the directory in which the " & _
  503. "expanded CHM directories are located must be specified so that the " & _
  504. "HTM descriptions can be extracted. In which directory are the expanded CHM " & _
  505. "directories located?")
  506. Else
  507. strHTMLocation = i_strBase
  508. End If
  509. Set DOMDoc = p_clsImporter.Hhc2Hht(i_strPathName, strHTMLocation)
  510. Set Node = tre(TI_HHC_E).Nodes.Add(ROOT_KEY_C, tvwChild, strFileName, strFileName)
  511. Set Node.Tag = XMLFindFirstNode(DOMDoc, HHT_TAXONOMY_ENTRIES_C)
  512. p_CreateTree TI_HHC_E, DOMDoc, Node
  513. If (p_strMissingFiles <> "") Then
  514. MsgBox "The following files couldn't be found: " & p_strMissingFiles
  515. End If
  516. If (p_strCorruptFiles <> "") Then
  517. MsgBox "The following files are corrupt: " & p_strCorruptFiles
  518. End If
  519. Case FILE_EXT_HHK_C
  520. If (p_NodeExists(TI_HHK_E, strFileName)) Then
  521. GoTo LEnd
  522. End If
  523. If (i_strBase = "") Then
  524. strHTMLocation = InputBox("For importing HHKs, the directory in which the " & _
  525. "expanded CHM directories are located must be specified so that the " & _
  526. "HTM titles can be extracted. In which directory are the expanded CHM " & _
  527. "directories located?")
  528. Else
  529. strHTMLocation = i_strBase
  530. End If
  531. Set DOMDoc = p_clsImporter.Hhk2Hht(i_strPathName, strHTMLocation)
  532. Set Node = tre(TI_HHK_E).Nodes(ROOT_KEY_C)
  533. p_CreateTree TI_HHK_E, DOMDoc, Node
  534. Set DOMNode = XMLFindFirstNode(DOMDoc, HHT_TAXONOMY_ENTRY_C)
  535. Node.Tag.appendChild DOMNode
  536. ' HHK Nodes are invisible by default
  537. XMLSetAttribute DOMNode, HHT_VISIBLE_C, "FALSE"
  538. Case FILE_EXT_XLS_C
  539. If (p_NodeExists(TI_XLS_E, strFileName)) Then
  540. GoTo LEnd
  541. End If
  542. Set DOMDoc = p_clsImporter.Xls2Hht(i_strPathName)
  543. Set Node = tre(TI_XLS_E).Nodes.Add(ROOT_KEY_C, tvwChild, strFileName, strFileName)
  544. Set Node.Tag = XMLFindFirstNode(DOMDoc, HHT_TAXONOMY_ENTRIES_C)
  545. p_CreateTree TI_XLS_E, DOMDoc, Node
  546. Case FILE_EXT_HTM_C
  547. strParentNode = i_strBase
  548. If (strParentNode = "") Then
  549. strParentNode = "Single HTMs"
  550. End If
  551. If (Not p_NodeExists(TI_HTM_E, strParentNode)) Then
  552. Set Node = tre(TI_HTM_E).Nodes.Add(ROOT_KEY_C, tvwChild, strParentNode, _
  553. strParentNode)
  554. Set DOMDoc = New MSXML2.DOMDocument
  555. Set Element = DOMDoc.createElement(HHT_TAXONOMY_ENTRIES_C)
  556. Set DOMNode = DOMDoc.appendChild(Element)
  557. Set Node.Tag = DOMNode
  558. Else
  559. Set Node = tre(TI_HTM_E).Nodes(strParentNode)
  560. End If
  561. Set DOMDoc = p_clsImporter.Htm2Hht(i_strPathName, i_strBase)
  562. p_CreateTree TI_HTM_E, DOMDoc, Node
  563. Set DOMNode = XMLFindFirstNode(DOMDoc, HHT_TAXONOMY_ENTRY_C)
  564. Node.Tag.appendChild DOMNode
  565. Case FILE_EXT_CHM_C
  566. strBaseDir = Environ$("TEMP") & "\__HSCCHM\"
  567. If (Not FSO.FolderExists(strBaseDir)) Then
  568. FSO.CreateFolder strBaseDir
  569. End If
  570. strChmDir = strBaseDir & strFileName
  571. If (FSO.FolderExists(strChmDir)) Then
  572. FSO.DeleteFolder strChmDir, True
  573. End If
  574. FSO.CreateFolder strChmDir
  575. Set WS = CreateObject("Wscript.Shell")
  576. strCmd = "hh -decompile " & strChmDir & " " & i_strPathName
  577. WS.Run strCmd, , True
  578. For Each vntFile In FSO.GetFolder(strChmDir).Files
  579. If (UCase$(FileExtension(vntFile)) = FILE_EXT_HTM_C) Then
  580. AddFile vntFile, strFileName
  581. ElseIf (UCase$(FileExtension(vntFile)) = FILE_EXT_HHK_C) Then
  582. AddFile vntFile, strBaseDir
  583. Else
  584. AddFile vntFile, strBaseDir
  585. End If
  586. Next
  587. FSO.DeleteFolder strChmDir, True
  588. End Select
  589. LEnd:
  590. Me.MousePointer = vbDefault
  591. Exit Sub
  592. LErrorHandler:
  593. Me.MousePointer = vbDefault
  594. If (strChmDir <> "") Then
  595. FSO.DeleteFolder strChmDir, True
  596. End If
  597. Select Case Err.Number
  598. Case errBadSpreadsheet
  599. MsgBox "The Excel Spreadsheet is probably open or formatted incorrectly. " & _
  600. "Please make sure that the Spreadsheet is closed.", _
  601. vbExclamation Or vbOKOnly
  602. Case errVendorStringNotConfigured
  603. MsgBox "The database is not configured with a vendor string.", _
  604. vbExclamation Or vbOKOnly
  605. Case Else:
  606. g_ErrorInfo.SetInfoAndRaiseError "AddFile"
  607. End Select
  608. End Sub
  609. Private Sub p_CreateTree( _
  610. ByVal i_intIndex As Long, _
  611. ByVal i_DOMNode As MSXML2.IXMLDOMNode, _
  612. ByVal i_Node As Node _
  613. )
  614. On Error GoTo LErrorHandler
  615. Dim DOMNode As MSXML2.IXMLDOMNode
  616. Dim Node As Node
  617. Dim strTitle As String
  618. Dim strURI As String
  619. Dim strHtm As String
  620. Dim intPos As Long
  621. If (i_DOMNode.nodeName = HHT_TAXONOMY_ENTRY_C) Then
  622. strTitle = XMLGetAttribute(i_DOMNode, HHT_TITLE_C)
  623. strURI = Trim$(XMLGetAttribute(i_DOMNode, HHT_URI_C))
  624. If (i_intIndex = TI_HTM_E) Then
  625. intPos = InStrRev(strURI, "/")
  626. strHtm = Mid$(strURI, intPos + 1)
  627. strTitle = strTitle & " (" & strHtm & ")"
  628. End If
  629. Set Node = tre(i_intIndex).Nodes.Add(i_Node, tvwChild, Text:=strTitle)
  630. Set Node.Tag = i_DOMNode
  631. ' Color new URIs blue
  632. If (Not p_dictURIs.Exists(strURI)) Then
  633. Node.ForeColor = vbBlue
  634. End If
  635. Else
  636. Set Node = i_Node
  637. End If
  638. If (Not (i_DOMNode.firstChild Is Nothing)) Then
  639. Node.Image = IMAGE_GROUP_E
  640. For Each DOMNode In i_DOMNode.childNodes
  641. p_CreateTree i_intIndex, DOMNode, Node
  642. Next
  643. Else
  644. Node.Image = IMAGE_LEAF_E
  645. End If
  646. LEnd:
  647. Exit Sub
  648. LErrorHandler:
  649. g_ErrorInfo.SetInfoAndRaiseError "p_CreateTree"
  650. GoTo LEnd
  651. End Sub
  652. Public Function GetSelectedSKUs() As SKU_E
  653. Dim enumSelectedSKUs As SKU_E
  654. GetSelectedSKUs = 0
  655. If (chkSKU(SI_WINDOWS_MILLENNIUM_E).Value = 1) Then
  656. enumSelectedSKUs = enumSelectedSKUs Or SKU_WINDOWS_MILLENNIUM_E
  657. End If
  658. If (chkSKU(SI_STANDARD_E).Value = 1) Then
  659. enumSelectedSKUs = enumSelectedSKUs Or SKU_STANDARD_E
  660. End If
  661. If (chkSKU(SI_PROFESSIONAL_E).Value = 1) Then
  662. enumSelectedSKUs = enumSelectedSKUs Or SKU_PROFESSIONAL_E
  663. End If
  664. If (chkSKU(SI_PROFESSIONAL_64_E).Value = 1) Then
  665. enumSelectedSKUs = enumSelectedSKUs Or SKU_PROFESSIONAL_64_E
  666. End If
  667. If (chkSKU(SI_SERVER_E).Value = 1) Then
  668. enumSelectedSKUs = enumSelectedSKUs Or SKU_SERVER_E
  669. End If
  670. If (chkSKU(SI_ADVANCED_SERVER_E).Value = 1) Then
  671. enumSelectedSKUs = enumSelectedSKUs Or SKU_ADVANCED_SERVER_E
  672. End If
  673. If (chkSKU(SI_ADVANCED_SERVER_64_E).Value = 1) Then
  674. enumSelectedSKUs = enumSelectedSKUs Or SKU_ADVANCED_SERVER_64_E
  675. End If
  676. If (chkSKU(SI_DATA_CENTER_SERVER_E).Value = 1) Then
  677. enumSelectedSKUs = enumSelectedSKUs Or SKU_DATA_CENTER_SERVER_E
  678. End If
  679. If (chkSKU(SI_DATA_CENTER_SERVER_64_E).Value = 1) Then
  680. enumSelectedSKUs = enumSelectedSKUs Or SKU_DATA_CENTER_SERVER_64_E
  681. End If
  682. GetSelectedSKUs = enumSelectedSKUs
  683. End Function
  684. Private Function p_GetHelpDir() As HELPDIR_E
  685. If (optHelp(HDI_HELP_MSITS_E).Value) Then
  686. p_GetHelpDir = HELPDIR_HELP_MSITS_E
  687. ElseIf (optHelp(HDI_HELP_HCP_E).Value) Then
  688. p_GetHelpDir = HELPDIR_HELP_HCP_E
  689. ElseIf (optHelp(HDI_SYSTEM_E).Value) Then
  690. p_GetHelpDir = HELPDIR_SYSTEM_E
  691. ElseIf (optHelp(HDI_VENDOR_E).Value) Then
  692. p_GetHelpDir = HELPDIR_VENDOR_E
  693. End If
  694. End Function
  695. Private Function p_NodeExists( _
  696. ByVal i_intIndex As Long, _
  697. ByVal i_strKey As String _
  698. ) As Boolean
  699. On Error GoTo LErrorHandler
  700. Dim Node As Node
  701. Set Node = tre(i_intIndex).Nodes(i_strKey)
  702. p_NodeExists = True
  703. Exit Function
  704. LErrorHandler:
  705. p_NodeExists = False
  706. End Function
  707. Private Sub p_SetSizingInfo()
  708. Static blnInfoSet As Boolean
  709. If (blnInfoSet) Then
  710. Exit Sub
  711. End If
  712. p_clsSizer.AddControl SSTab
  713. Set p_clsSizer.ReferenceControl(DIM_HEIGHT_E) = Me
  714. Set p_clsSizer.ReferenceControl(DIM_WIDTH_E) = Me
  715. p_clsSizer.AddControl tre(TI_HHC_E)
  716. Set p_clsSizer.ReferenceControl(DIM_HEIGHT_E) = SSTab
  717. Set p_clsSizer.ReferenceControl(DIM_WIDTH_E) = SSTab
  718. p_clsSizer.AddControl tre(TI_HHK_E)
  719. Set p_clsSizer.ReferenceControl(DIM_HEIGHT_E) = SSTab
  720. Set p_clsSizer.ReferenceControl(DIM_WIDTH_E) = SSTab
  721. p_clsSizer.AddControl tre(TI_HTM_E)
  722. Set p_clsSizer.ReferenceControl(DIM_HEIGHT_E) = SSTab
  723. Set p_clsSizer.ReferenceControl(DIM_WIDTH_E) = SSTab
  724. p_clsSizer.AddControl tre(TI_XLS_E)
  725. Set p_clsSizer.ReferenceControl(DIM_HEIGHT_E) = SSTab
  726. Set p_clsSizer.ReferenceControl(DIM_WIDTH_E) = SSTab
  727. p_clsSizer.AddControl cmdClose
  728. Set p_clsSizer.ReferenceControl(DIM_TOP_E) = Me
  729. p_clsSizer.ReferenceDimension(DIM_TOP_E) = DIM_HEIGHT_E
  730. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = Me
  731. p_clsSizer.ReferenceDimension(DIM_LEFT_E) = DIM_WIDTH_E
  732. p_clsSizer.AddControl fraSKU
  733. Set p_clsSizer.ReferenceControl(DIM_TOP_E) = SSTab
  734. p_clsSizer.ReferenceDimension(DIM_TOP_E) = DIM_BOTTOM_E
  735. Set p_clsSizer.ReferenceControl(DIM_WIDTH_E) = Me
  736. p_clsSizer.Operation(DIM_WIDTH_E) = OP_MULTIPLY_E
  737. p_clsSizer.AddControl chkSKU(SI_SERVER_E)
  738. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = fraSKU
  739. p_clsSizer.ReferenceDimension(DIM_LEFT_E) = DIM_WIDTH_E
  740. p_clsSizer.Operation(DIM_LEFT_E) = OP_MULTIPLY_E
  741. p_clsSizer.AddControl chkSKU(SI_ADVANCED_SERVER_E)
  742. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = chkSKU(SI_SERVER_E)
  743. p_clsSizer.AddControl chkSKU(SI_ADVANCED_SERVER_64_E)
  744. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = chkSKU(SI_SERVER_E)
  745. p_clsSizer.AddControl chkSKU(SI_DATA_CENTER_SERVER_E)
  746. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = chkSKU(SI_SERVER_E)
  747. p_clsSizer.AddControl chkSKU(SI_DATA_CENTER_SERVER_64_E)
  748. Set p_clsSizer.ReferenceControl(DIM_LEFT_E) = chkSKU(SI_SERVER_E)
  749. p_clsSizer.AddControl fraHelp
  750. Set p_clsSizer.ReferenceControl(DIM_TOP_E) = SSTab
  751. p_clsSizer.ReferenceDimension(DIM_TOP_E) = DIM_BOTTOM_E
  752. Set p_clsSizer.ReferenceControl(DIM_WIDTH_E) = Me
  753. p_clsSizer.Operation(DIM_WIDTH_E) = OP_MULTIPLY_E
  754. p_clsSizer.AddControl txtSubDir
  755. Set p_clsSizer.ReferenceControl(DIM_WIDTH_E) = fraHelp
  756. blnInfoSet = True
  757. End Sub
  758. Private Sub p_SetToolTips()
  759. tre(TI_HHC_E).ToolTipText = "Imported Table of Content files (.hhc) will be displayed here."
  760. tre(TI_HHK_E).ToolTipText = "Imported Index files (.hhk) will be displayed here."
  761. tre(TI_HTM_E).ToolTipText = "Imported Topic files (.htm) will be displayed here."
  762. tre(TI_XLS_E).ToolTipText = "Imported Excel files (.xls) will be displayed here."
  763. fraSKU.ToolTipText = "Select the appropriate SKU for the files you wish to import."
  764. fraHelp.ToolTipText = "Select the appropriate format for the URI"
  765. lblSubDir.ToolTipText = "Type the subdirectory, if needed, to append to the Help file directory."
  766. txtSubDir.ToolTipText = lblSubDir.ToolTipText
  767. End Sub