Re: How to run Eu pgm FROM Eu pgm, with PARAMETERS (for 2nd Eu pgm)
- Posted by Dan_M Jul 11, 2009
- 1217 views
On this machine, I'm running Win32Lib 0.60.5, under Eu 2.5, and when I run my "wrap", I get a return code of 5, and NOTHING seems to happen.
When I put a wait_key() at the end of one of the file compares, in case it was displaying in cmd window too quickly to see, I see NOTHING. That's why I was thinking maybe spaces in path made the file compare not run when executed by shellExecuteEx.
And the "diffxx.ex" file compares are in same folder as the GUI "wrap".
Any suggestions on debug?
I've just done some testing here and its all working just fine.
I'm using Euphoria 4 and win32lib 0.70.16, so I can't directly comment on the results you are getting with old version of the programs.
Here is the programs I used ...
-- Main test program include win32lib.ew constant win = create(Window, "Shell", 0, 0, 0, 500, 500, 0) constant btn = create(Button, "Do It", win, 10, 10, 50, 50, 0) constant res = create(EditText, "", win, 10, 100, 250, 30, 0) integer cnt = 0 procedure click_Btn(integer self, integer event, sequence parms) cnt += 1 setText( res, sprintf("%02d RC=%d", {cnt, shellExecuteEx("open", "c:\\program files\\utils\\eui.exe", {"c:\\temp\\tests.ex","Q","W R"}, 0, 0, 0) } ) ) end procedure setHandler( btn, w32HClick,routine_id("click_Btn")) WinMain(win, Normal)
-- Program that is invoked (tests.ex). sequence c = command_line() integer fh fh = open("c:\\temp\\test.res", "w") for i = 1 to length(c) do printf(fh, "%2d '%s'\n", {i, c[i]}) end for close(fh)
Results...
1 'c:\program files\utils\eui.exe' 2 'c:\temp\tests.ex' 3 'Q' 4 'W R'
Derek,
I'm pretty sure my problem IS because of spaces in path name, at least when the path/file name used as a parameter is procured from getOpenFileName.
When I make a small test program to be called by shellExecuteEx, with "test" as the first parameter for the TEST program,
and a path/file name returned by getOpenFileName as the second parameter,
here's what I get output by the test pgm:
C:\PROGRA~2\EUPHORIA\BIN\EX.EXE <-- interpreter test.ex <-- test program test <-- first param for test pgm C:\Programming\EUPHORIA\Programs <-- ALL is SENT as the second parameter! Under <-- but separated and TREATED as THREE param Development\FromIde\CompareFiles\cp1a1b.exwSo I'm sending a sequence variable SecondFile as the second parameter to the test file, not
"C:\\Programming\\EUPHORIA\\Programs Under Development\\FromIde\\CompareFiles\\cp1a1b.exw"even though they should be approx. the same thing.
I know there's a way to make that be taken as "one" item, but I forget what it is.
Looks like it has to do with the DOUBLE slashes,
but like I said, I forget how to "trick" Eu into thinking they're there
if that's what it takes.
Dan