Jazkal Posted December 13, 2006 Posted December 13, 2006 (edited) I am trying to get SmartWim working with AutoIt3, but I'm having trouble with the progress output.You can get the smartwim dll here: SmartWimThey give a VBScript example:Dim objSmartWim, ResultCode Set objSmartWim = WScript.CreateObject("SmartWim", "objSmartWim_") objSmartWim.File = "C:\Image.wim" objSmartWim.Image = "My Test Image" objSmartWim.Path = "C:\Test" objSmartWim.Temp = "C:\WINDOWS\Temp" ResultCode = objSmartWim.CaptureImage(False) WScript.Echo objSmartWim.GetErrorDescription(ResultCode) Set objSmartWim = Nothing Sub objSmartWim_Progress(ByVal nPercent, ByVal nSeconds) WScript.Echo nPercent & "% complete, " & nSeconds & " remaining" End SubHere is what I have converted to Autoit3 so far:Dim $objSmartWim Dim $ResultCode ;$objSmartWim = ObjCreate("SmartWim", "objSmartWim_") $objSmartWim = ObjCreate("SmartWim") $objSmartWim.File = "C:\ImageTest.wim" $objSmartWim.Image = "My Test Image" $objSmartWim.Path = "C:\Temp" $objSmartWim.Temp = "C:\WINDOWS\Temp" $ResultCode = $objSmartWim.CaptureImage(False) MsgBox(4096, "Test", $objSmartWim.GetErrorDescription($ResultCode), 5)Any ideas? Edited December 13, 2006 by Jazkal
Moderators big_daddy Posted December 13, 2006 Moderators Posted December 13, 2006 I filled out the download form and they sent me a link but it was broken.
Jazkal Posted December 13, 2006 Author Posted December 13, 2006 (edited) Here is the one I got from the download link: EDIT: I think I need to use ObjEvent, but can't seem to get it to work. Could be wrong though. Edited November 28, 2007 by Jon
Moderators big_daddy Posted December 13, 2006 Moderators Posted December 13, 2006 See if this works. $oSmartWim = ObjCreate("SmartWim") If @error Then MsgBox(64, "Warning", "You must first register the dll.") $sFile = FileOpenDialog("Open Dll", @ScriptDir, "DLL (*.dll)", 1, "SmartWim.dll") If @error Then MsgBox(48, "Error", "Unable to register the dll.") Exit EndIf ShellExecuteWait("regsvr32.exe", '"' & $sFile & '"') $oSmartWim = ObjCreate("SmartWim") If @error Then MsgBox(48, "Error", "Still unable to create SmartWim Object.") Exit EndIf EndIf $oEvent = ObjEvent($oSmartWim, "Evt_") With $oSmartWim .File = "C:\Image.wim" .Image = "My Test Image" .Path = "C:\Test" .Temp = "C:\WINDOWS\Temp" $ResultCode = .CaptureImage (False) EndWith MsgBox(64, "Result", $oSmartWim.GetErrorDescription ($ResultCode)) $oEvent = 0 $oSmartWim = 0 Func Evt_Progress($nPercent, $nSeconds) ToolTip($nPercent & "% complete, " & $nSeconds & " remaining") EndFunc ;==>Evt_Progress
Jazkal Posted December 13, 2006 Author Posted December 13, 2006 It creates the WIM file, but doesn't show any progress.
Moderators big_daddy Posted December 13, 2006 Moderators Posted December 13, 2006 (edited) Without a license key I don't have anyway of testing it.Edit: Figured out I don't need a key so let me try to figure out how to make a .wim file. Edited December 13, 2006 by big_daddy
Jazkal Posted December 15, 2006 Author Posted December 15, 2006 I converted your ToolTip to a ProgressOn - Set, and it showed 0% until it was done, then showed 2%, then after clicking on "Ok", it jumps to 9% right before it disappears.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now