03-30-2014, 12:02 AM
Hello All,
I have been using a modification of what is described here
http://www.quickmacros.com/forum/showthr...p?tid=4114
to call functions and pass arguments between two different QM-generated exe's running on network connected computers.
I run this in a rep or dlg timer loop in the exe and have it scan continously for any update in a trigger txt file on a network share. Clicking on a dlg button or some other event in the exe on the second pc causes a setfile event to the trigger txt (path is defined the same way in both exe's) with the function to run and any arguments to pass.
This mostly works but sometimes I get some weird delays or double triggers depending on whether I set the file on the 2nd computer (trigger origin) with setfile or CFileInterlocked FromStr. I think sometimes there is more than one modification of the file registered in the trigger pickup loop depending on how the file is "set".
Any thoughts on the best way to do this. I wish there was a version of net for exe's. I understand that this could be used dangerously but what can be done to set up something safe in a controlled situation (ie within network)?
Thanks!!!,
S
I have been using a modification of what is described here
http://www.quickmacros.com/forum/showthr...p?tid=4114
to call functions and pass arguments between two different QM-generated exe's running on network connected computers.
I run this in a rep or dlg timer loop in the exe and have it scan continously for any update in a trigger txt file on a network share. Clicking on a dlg button or some other event in the exe on the second pc causes a setfile event to the trigger txt (path is defined the same way in both exe's) with the function to run and any arguments to pass.
str FuncTriggered_Filepath = "\\networkshare\FuncTrigger.txt"
long+ TimeModPrev_FuncTrigger
Dir d_FuncTrigger
if d_FuncTrigger.dir(FuncTriggered_Filepath 0)
,long dtTimeMod_FuncTrigger =d_FuncTrigger.TimeModified(0 0 0 1)
,if TimeModPrev_FuncTrigger != dtTimeMod_FuncTrigger and TimeModPrev_FuncTrigger != 0
,,str FuncArgs.getfile(FuncTriggered_Filepath);err
,,if Arg != "NULL" and !empty(Arg);
,,;sameple file contents = "Func=Func1&Arg=TestArgTxt"
,,,str PassedFuncCall PassedArg
,,,findrx(FuncArgs "(?<=Func=)\w+?(?=&|$) 0 0 PassedFuncCall)
,,,findrx(FuncArgs "(?<=Arg=)\w+?(?=&|$) 0 0 PassedArg)
,,,sel PassedFuncCall
,,,,case "Func1"
,,,,,Func1 PassedArg
,,,,case "Func2"
,,,,,Func2 PassedArg
,,,,case "Func3"
,,,,,Func3 PassedArg
,TimeModPrev_FuncTrigger = dtTimeMod_FuncTrigger
This mostly works but sometimes I get some weird delays or double triggers depending on whether I set the file on the 2nd computer (trigger origin) with setfile or CFileInterlocked FromStr. I think sometimes there is more than one modification of the file registered in the trigger pickup loop depending on how the file is "set".
Any thoughts on the best way to do this. I wish there was a version of net for exe's. I understand that this could be used dangerously but what can be done to set up something safe in a controlled situation (ie within network)?
Thanks!!!,
S