ofLight Posted October 10, 2007 Share Posted October 10, 2007 Can anyone help me with this Translation? I have started to convert it over but am haveing trouble with the last part this is the Original Dim objSmartWIM, ResultCode Set objSmartWIM = WScript.CreateObject("SmartWIM", "objSmartWIM_") objSmartWIM.File = "C:\Image.wim" objSmartWIM.Image = "My Test Image" objSmartWIM.Path = "C:\Dell" 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 Sub Obveously I am screwin it up Dim $objSmartWIM, $ResultCode $objSmartWIM = ObjCreate("SmartWIM") $objSmartWIM.File = "C:\Image.wim" $objSmartWIM.Image = "My Test Image" $objSmartWIM.Path = "C:\Dell" $objSmartWIM.Temp = "C:\WINDOWS\Temp" $ResultCode = $objSmartWIM.CaptureImage(False) GUICreate("SmartWIM",400,75) Global $Label = GUICtrlCreateLabel( $objSmartWIM.GetErrorDescription($ResultCode) ,10,10) Global $progress = GUICtrlCreateProgress(10,40) GUISetState(@SW_SHOW) $objSmartWIM = "" ;Sub objSmartWIM_Progress(ByVal nPercent, ByVal nSeconds) ;WScript.Echo nPercent & "% complete, " & nSeconds & " remaining" ;End Sub There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly Link to comment Share on other sites More sharing options...
ofLight Posted October 10, 2007 Author Share Posted October 10, 2007 Alright, Ive been pooring over the Forums and Help file and am pretty sure the correct translation of that last part is going to involve "ObjEvent", But I could really use any Suggestions or help on this. There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly Link to comment Share on other sites More sharing options...
PsaltyDS Posted October 10, 2007 Share Posted October 10, 2007 You might want to review this topic: SmartWim code help? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
ofLight Posted October 10, 2007 Author Share Posted October 10, 2007 Thanks for the Comment Psalty, I actually already read that post, and it did help me to get started with the direct commands like Creation and Capture. Unfortunatly it doesnt show howto handle incoming events, such as the progress bar % and such. I think I am getting closer but still no CegarDim $objSmartWIM, $ResultCode $objSmartWIM = ObjCreate("SmartWIM") $SinkObject=ObjEvent($objSmartWIM,"objSmartWIM_") $objSmartWIM.File = "C:\Image.wim" $objSmartWIM.Image = "My Test Image" $objSmartWIM.Path = "C:\Dell" $objSmartWIM.Temp = "C:\WINDOWS\Temp" $ResultCode = $objSmartWIM.CaptureImage(False) ProgressOn("SmartWIM", "") MsgBox(0, $objSmartWIM.GetErrorDescription($ResultCode),"") $objSmartWIM = 0 Func objSmartWIM_Progress( $nPercent, $nSeconds) $percent = Int( ($nPercent * 100) / 200 ) If $percent >= 0 And $percent <= 100 Then ProgressSet ( $percent , $nSeconds & " Seconds to go." , "Creating WIM" ) EndIf EndFunc There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly Link to comment Share on other sites More sharing options...
ofLight Posted October 11, 2007 Author Share Posted October 11, 2007 Ok, I think I have correctly translated the script from the original, however it still doesnt work. I am recieving some of the Events, but only at the end of the script, basicly the same problem from the other thread Psalty mentioned. Can anyone tell if it looks like I am useing ObjEvent correctly ? Dim $objSmartWIM, $ResultCode $objSmartWIM = ObjCreate("SmartWIM") $EventObject=ObjEvent($objSmartWIM,"Event_") $objSmartWIM.File = "C:\Image.wim" $objSmartWIM.Image = "My Test Image" $objSmartWIM.Path = "C:\Dell" $objSmartWIM.Temp = "C:\WINDOWS\Temp" $ResultCode = $objSmartWIM.CaptureImage(False) MsgBox(0, $objSmartWIM.GetErrorDescription($ResultCode),"") $objSmartWIM = 0 Func Event_Progress( $nPercent, $nSeconds) MsgBox(0,"", $nPercent& "% complete, " & $nSeconds & " remaining",2) EndFunc There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly Link to comment Share on other sites More sharing options...
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