Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
RedirectQmOutput Help.
#1
Gintaras

I wrote the below function to help me log my progress on some installation scripts I do. I go through several reboots and just needed to know where the process was at. While this worked fine, it did not log random failures. Can I get an example of how use RedirectQmOutput to accomplish this?

I put in the ExeOutPutWindow and it works fine thanks for that. The commented out stuff is how I used to do it before 2.4.1.3, I found qmoutmon on here and compiled it.

Also an example of how to use RedirectQmOutput in a Simple Dialog that is created with quick macros would also be helpful

Thanks

Function _mjout
Code:
Copy      Help
;/
function# str'outmj
;int w999=win("QM out monitor" "QM_Editor")
;ifi-(w999)
,;run "C:\mjinstalls\qmoutmon.exe" "" "" "" 0x10000
str name.getfilename(ExeFullPath)
ExeOutputWindow 0 name
str mtime.timeformat
str s=s.from(F"{mtime}    ", outmj)
out s
LogFile s 0 "c:\mjinstalls\mjinstalls.log"
#2
Macro Macro2285
Code:
Copy      Help
;/exe
RedirectQmOutput &RedirectQmOutputToLogFile
;out ;;delete the log file
out "test" ;;write to the log file
if mes("Open log file?" "" "YN")
,run "notepad.exe" F"''{_logfile}''"
Function RedirectQmOutputToLogFile
Code:
Copy      Help
;/
function# str&s reserved

if &s
,LogFile s
else
,if(FileExists(_logfile)) del- _logfile

ret 1

Don't use ExeOutputWindow and RedirectQmOutput in the same exe process, because then will work either ExeOutputWindow or your callback function, not both.

Quote:Also an example of how to use RedirectQmOutput in a Simple Dialog that is created with quick macros would also be helpful
ExeOutputWindow is an example. Actually most code is in EOW_Dialog. ExeOutputWindow just opens the dialog. EOW_OutRedirProc captures text and sends to the dialog.
#3
Thanks


Forum Jump:


Users browsing this thread: 1 Guest(s)