Jump to content

noonand

Member
  • Posts

    2
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United States

Everything posted by noonand

  1. Hi, I've got a drive imaging app for .wim files all working in HTA using SmartWim, but when I use it in Windows PE the Microsoft Common Dialog control (comdlg32.ocx) to browse for files doesn't work. code snippet: <object id="objSmartWim" style="display:none" classid="CLSID:14B92924-451C-4C17-A65A-9FEC9E2547DA" viewastext="true"></object> <script language="vbscript"> Dim ReturnCode ' Common dialog constants Const OFN_OVERWRITEPROMPT = &H2 Const OFN_HIDEREADONLY = &H4 Const OFN_NOCHANGEDIR = &H8 Const OFN_PATHMUSTEXIST = &H800 objSmartWim.File = OpenFile() objSmartWim.Path = "C:\test" objSmartWim.Image = "image1" ReturnCode = objSmartWim.CaptureImage(True) Function OpenFile() Dim objComDlg Set objComDlg = CreateObject("MSComDlg.CommonDialog") With objComDlg .DialogTitle = "Open" .Filter = "Windows image (.wim) files|*.wim" .MaxFileSize = 255 .Flags = .Flags Or OFN_HIDEREADONLY Or OFN_PATHMUSTEXIST Or OFN_NOCHANGEDIR .ShowOpen If (.FileName <> "") Then OpenFile = .FileName End If End With Set objComDlg = Nothing End Sub I think it has to do with licensing, but not sure. Does anyone know how to get comdlg32.ocx to work in PE? Thanks!
  2. I wrote a VB6 disk imaging app using SmartWim instead of the wimgapi sdk because of the hanging issues and lack of event sinking to script clients. SmartWim is an ActiveX component from http://www.smartdeploy.com that is based on the Wimgapi SDK and works flawlessly in VB, VBScript, DHTML, etc. For instance, here is some VB6 code that applies an image while displaying a progress bar: ' In a form Private WithEvents objSmartWim As SmartWim Private Sub Command1_Click() Dim ResultCode As swcError Set objSmartWim = New SmartWim objSmartWim.File = "C:\Image.wim" objSmartWim.Name = "My Test Image" objSmartWim.Path = "C:\Test" ResultCode = objSmartWim.ApplyImage() MsgBox objSmartWim.GetErrorDescription(ResultCode) Set objSmartWim = Nothing End Sub Private Sub objSmartWim_Progress(ByVal nPercent As Integer, ByVal nSeconds As Long) ProgressBar1.Value = nPercent End Sub That's it! No hangs, no gigantic declare sections, etc. Have fun...
×
×
  • Create New...