1. message_box() with eui=OK, after bind = not OK
- Posted by sergelli Aug 15, 2010
- 1338 views
Hello
The code below (wwait.exw) works well when run with eui.exe But do not run after bind (wwait.exe) running white WinXp Sp3 and Eu40b3
This is the error message:
C: \ 40b3-euphoria \ include \ msgbox.e: 71 in message_box function () Has not Been <no-name> variable assigned the value ... called from WWAIT.exw: 1
and this is the file ex.err
C: \ 40b3-euphoria \ include \ msgbox.e: 71 in message_box function () Has not Been <no-name> variable assigned the value <no-name> 84'T = ('69'E,' 83'S '84'T', 32 '', 77'M '69'E,' 83'S, '83'S', 65'A ' 71'G '69'E', 32 ',' 66'B '79'O', 88'X ') <no-name> 77'M = ('101'e', 115's, '115's', 97'a ', 103'g' 101'e ', 32', '66'B' 111'o '120'x') <no-name> = 48'0 ' <no-name> = 48'0 ' <no-name> = 10560616 <no-name> = 10739672 <no-name> = <no value> <no-name> = <no value> ... called from WWAIT.exw: 1 Global & Local Variables
How i do correctely this "wwait.exe"?
In ex.err, what to do for the variables <no name> show their correct names?
Thanks in advance!
opss... the code wwai.exw
include win32lib.ew atom res res=message_box("TEST MESSAGE BOX","Message Box",MB_ICONEXCLAMATION)
2. Re: message_box() with eui=OK, after bind = not OK
- Posted by ChrisB (moderator) Aug 15, 2010
- 1281 views
Hi
bind the application with the -full_debug switch, to show variable names that throw the error. The answer (and usually the solution) will then often reveal itself.
Chris
3. Re: message_box() with eui=OK, after bind = not OK - RESOLVED
- Posted by sergelli Aug 15, 2010
- 1299 views
Thank you Chris!
Once again you helped precisely, with clear shot on target.
The variable that was causing mistakes to be empty was "msgbox_id" within the file C: \ 40b3-euphoria \ include \ msgbox.e in message_box function ()
The reason is because the function platform() returns DOS32 not WIN32 in my system.
The file "msgbox.e" does not allow open DLLs for system alternatives like DOS32 and LINUX.
I changed the line
IF platform () = WIN32 then
to
IF platform () = WIN32 or platform () = DOS32 then
and is now working OK
strange that with eui and euiw, worked well even without the above correction
Thank you
4. Re: message_box() with eui=OK, after bind = not OK - RESOLVED
- Posted by mattlewis (admin) Aug 15, 2010
- 1260 views
The reason is because the function platform() returns DOS32 not WIN32 in my system.
[snip]
strange that with eui and euiw, worked well even without the above correction
eui and euiw are windows executables, so platform() should be returning WIN32. What interpreter are you using that is returning DOS32?
Matt
5. Re: message_box() with eui=OK, after bind = not OK - RESOLVED
- Posted by SPringle Aug 15, 2010
- 1261 views
This is something that used to happen when we cross translated. A new interpreter would inherit its platform() value from the translator's platform even when translating for another platform. This is the explanation I can come up with. If he he can compile his source he should do: configure plat WIN and then wmake all.
There should be a test for this kind of problem. There is a uname() call for verifying platform() and ifdefs.
Shawn Pringle
6. Re: message_box() with eui=OK, after bind = not OK - RESOLVED
- Posted by SergioGelli Aug 16, 2010
- 1258 views
eui and euiw are windows executables, so platform() should be returning WIN32. What interpreter are you using that is returning DOS32? Matt
I am using EU40b3 (?)
Yes, when I use the ".EXE" produced with the EU40b3, the problem only occurs in systems that the result of the function platform ()! = WIN32 Otherwise works fine.
But this can not be admissible because there are many older PCs that are maintained because they are working with expensive equipment and can not be turned off.
How to explain to the owner of such equipment that EU40b3 is not compatible? Why not work with DOS32 ?
Also I do not understand why there are old programs, eg DBASE IV PLUS borned in 1994 that keeps working fine in WinXp, winVista and Win7, no problem despite being DOS32. But,the simple code "wwait.exe" (posted above), with only one function, not works with this platforms.
If I am thinking wrong, please let me know.
7. Re: message_box() with eui=OK, after bind = not OK - RESOLVED
- Posted by mattlewis (admin) Aug 16, 2010
- 1254 views
eui and euiw are windows executables, so platform() should be returning WIN32. What interpreter are you using that is returning DOS32? Matt
I am using EU40b3 (?)
Yes, when I use the ".EXE" produced with the EU40b3, the problem only occurs in systems that the result of the function platform ()! = WIN32 Otherwise works fine.
That actually sounds like a bug. It should be returning WIN32, since DOS support was dropped for v4. None of the euphoria binaries shipped with beta 3 should be reporting DOS32 from platform(). You may be unintentionally running a different interpreter (like ex.exe from 3.1?).
But this can not be admissible because there are many older PCs that are maintained because they are working with expensive equipment and can not be turned off.
How to explain to the owner of such equipment that EU40b3 is not compatible? Why not work with DOS32 ?
Also I do not understand why there are old programs, eg DBASE IV PLUS borned in 1994 that keeps working fine in WinXp, winVista and Win7, no problem despite being DOS32. But,the simple code "wwait.exe" (posted above), with only one function, not works with this platforms.
If I am thinking wrong, please let me know.
Those old programs are probably DOS programs. There is a difference in the way the executable is built. Euphoria is supported by volunteers, and there has been no one interested in supporting a DOS port for some time.
DOS programs cannot access Windows dlls, which is what the message box code does.
Matt
8. Re: message_box() with eui=OK, after bind = not OK - RESOLVED
- Posted by useless Aug 16, 2010
- 1239 views
DOS programs cannot access Windows dlls, which is what the message box code does.
Matt
Didn't Achury or Mic write Eu v3 code to access windoze dll's from dos? I think it was "GenDLL" ? If i remember correctly, it's merely a matter of loading the dll in real mode and that dll not calling windose api in other dll that you didn't also load.
useless
9. Re: message_box() with eui=OK, after bind = not OK - RESOLVED
- Posted by jimcbrown (admin) Aug 16, 2010
- 1203 views
DOS programs cannot access Windows dlls, which is what the message box code does.
Matt
Didn't Achury or Mic write Eu v3 code to access windoze dll's from dos? I think it was "GenDLL" ? If i remember correctly, it's merely a matter of loading the dll in real mode and that dll not calling windose api in other dll that you didn't also load.
useless
Mic_ wrote it back in the days of v2.x and the DLL was loaded in protected mode, as Eu never had a real-mode DOS version.
More importantly, the message box calls windose api. So even with GenDLL, this won't work.
10. Re: message_box() with eui=OK, after bind = not OK
- Posted by SergioGelli Aug 16, 2010
- 1224 views
That actually sounds like a bug. It should be returning WIN32, since DOS support was dropped for v4. None of the euphoria binaries shipped with beta 3 should be reporting DOS32 from platform(). You may be unintentionally running a different interpreter (like ex.exe from 3.1?).
I did not use EX.EXE
To explain a bit better, I added the following line in the file MSGBOX.E
puts (1, sprintf ("WIN32 =% d \n DOS32 =% d \n platform () =% d", (WIN32, DOS32, platform ()}))
See below for steps to build the wwait.exw to wwait.exe
C: \ 001Eu4> bind-full_debug wwait
deleted 510 unused routines 5884 and unused variables.
May you now run wwait.exe
Press Enter
See the result of running WWAIT.EXE on a Win32 screen
C: \ 001Eu4> wwait
C: \ 001Eu4> WIN32 = 2
DOS32 = 1
platform () = 2
See the result of running WWAIT.EXE on a DOS screen
C: \ 001Eu4> wwait
C: \ 001Eu4> WIN32 = 2
DOS32 = 1
platform () = 1
That's the problem reazon:
MSGBOX.E do not works with platform()=1
Those old programs are probably DOS programs. There is a difference in the way the executable is built. Euphoria is supported by volunteers, and there has been no one interested in supporting a DOS port for some time.
DOS programs cannot access Windows dlls, which is what the message box code does.
Matt
Means, do not use EU40b3 in DOS platform ?
11. Re: message_box() with eui=OK, after bind = not OK
- Posted by mattlewis (admin) Aug 16, 2010
- 1233 views
That actually sounds like a bug. It should be returning WIN32, since DOS support was dropped for v4. None of the euphoria binaries shipped with beta 3 should be reporting DOS32 from platform(). You may be unintentionally running a different interpreter (like ex.exe from 3.1?).
I did not use EX.EXE
See below for steps to build the wwait.exw to wwait.exe
C: \ 001Eu4> bind-full_debug wwait
I think you were using ex.exe (or, rather, its backend equivalent) without knowing it. What does the bat file bind-full_debug look like? And where is it located? I suspect it's calling a 3.1 version of bind.ex, which defaulted to creating DOS binaries. Windows binaries required a special flag passed.
Those old programs are probably DOS programs. There is a difference in the way the executable is built. Euphoria is supported by volunteers, and there has been no one interested in supporting a DOS port for some time.
DOS programs cannot access Windows dlls, which is what the message box code does.
Means, do not use EU40b3 in DOS platform ?
Not exactly. This means that you cannot use eu40b3 on DOS. Note that the command prompt is not the same thing as DOS.
Matt
12. Re: message_box() with eui=OK, after bind = not OK
- Posted by jimcbrown (admin) Aug 16, 2010
- 1244 views
eubw.exe is the culprit here, then. (Or possibly eub.exe, though the lack of a -CON option tells me that bind.ex/il.e is looking for and using eubw.exe)
It's possible an old bind.bat was used (the old one from before r2440 that specified euid.exe), in which case il.e (being run under euid.exe) would have "optimized" the call to platform() by hardcoding the return value of DOS.
13. Re: message_box() with eui=OK, after bind = not OK
- Posted by SergioGelli Aug 16, 2010
- 1205 views
ok ... ok ...
So it's looking me that is normal when "MSGBOX.E" not working when PLATFORM () = DOS32
14. Re: message_box() with eui=OK, after bind = not OK
- Posted by mattlewis (admin) Aug 16, 2010
- 1237 views
ok ... ok ...
So it's looking me that is normal when "MSGBOX.E" not working when PLATFORM () = DOS32
That's correct. In order to display the message box, the code calls part of the Windows API. It does not make sense to try to use facilities of an operating system other than the one under which your program is running (short of having an emulator or something similar to WINE).
Matt
15. Re: message_box() with eui=OK, after bind = not OK
- Posted by SergioGelli Aug 16, 2010
- 1173 views
So it's looking me that is normal when "MSGBOX.E" not working when PLATFORM () = DOS32
That's correct. In order to display the message box, the code calls part of the Windows API. It does not make sense to try to use facilities of an operating system other than the one under which your program is running (short of having an emulator or something similar to WINE).
Matt
I'm getting confused ...
Within a screen with the command line, the function platform () = DOS32 this is true in both command line WinXP or Wine
So I can not use the EU40b3 in the command line, to produce a "WWAIT.EXE?
Whow I do it?
16. Re: message_box() with eui=OK, after bind = not OK
- Posted by mattlewis (admin) Aug 16, 2010
- 1205 views
I'm getting confused ...
Within a screen with the command line, the function platform () = DOS32 this is true in both command line WinXP or Wine
So I can not use the EU40b3 in the command line, to produce a "WWAIT.EXE?
That's not correct. If you use either eui.exe or euiw.exe, you should get WIN32 (anything else is a bug). Those were the only interpreters shipped in beta 3. When you open up cmd.exe, you're still using Windows. You can run programs built for DOS from this, which usually result in the screen resetting to the full screen console view.
Older releases (I think DOS was still supported in beta 2, but I'm not sure) also shipped euid.exe, which was the v4 version of the DOS interpreter (although it might have still been ex.exe in the first or second beta...I'm not certain when the name changes happened in relation to previous beta releases).
I believe that you are not actually using the third beta to bind your program. Again, please check to make sure that you're using the correct batch file. If v3.1 is in your path before v4, then you may be using an older version which defaulted to producing DOS executables. It's not clear how, exactly, you're binding your program, since your previous message indicated you used a batch file named differently than was ever distributed in a euphoria release.
Matt
17. Re: message_box() with eui=OK, after bind = not OK
- Posted by SergioGelli Aug 16, 2010
- 1161 views
Definitely, I do not know how to explain.
I Use WinXP Sp3
I use Euphoria-40b3 ONLY
EUDIR = C:\EUPHORIA40b3\BIN
EUINC = C:WIN32LIB\INCLUDE -- I'm using the latest version at 70 if I remember correctly
I erased everything that belongs to Eu311. Nothing remains of the old versions of Euphoria
I have no folder containing EuFiles that are not originated by Eu40b3
BIND, BAT contains
eui EUDIR%% \ source \ bind.ex% 1% 2% 3% 4% 5% 6% 7% 8% 9
The file BIND.EX, is originates from eU40B3
Yet, the function platform() returns different results, depending on how it is called
eui wwait -> returns WIN32 euiw wwait -> returns WIN32
bind wwait produces wwait.exe
wwait.exe -> returns DOS32
To summarize: When not compiled, platform () = WIN32 After compiling, platform () = DOS32
If Eu40b3 has nothing to do with DOS what might be causing this problem?
18. Re: message_box() with eui=OK, after bind = not OK
- Posted by mattlewis (admin) Aug 16, 2010
- 1157 views
The file BIND.EX, is originates from eU40B3
Yet, the function platform() returns different results, depending on how it is called
eui wwait -> returns WIN32 euiw wwait -> returns WIN32
bind wwait produces wwait.exe
wwait.exe -> returns DOS32
To summarize: When not compiled, platform () = WIN32 After compiling, platform () = DOS32
If Eu40b3 has nothing to do with DOS what might be causing this problem?
OK...it sounds like a bug in the binder (or in the version of the backend runner [eub.exe] being used) in that case. Note that this is bound, not [translated and] compiled.
Matt
19. Re: message_box() with eui=OK, after bind = not OK
- Posted by SPringle Aug 16, 2010
- 1179 views
Yes, I just confirmed these results on my system. I am using the HEAD version.
Here is code for print_platform.ex:
include std/win32/msgbox.e atom ok sequence strings = { "DOS32", "WIN32" } ok = message_box( sprintf( "platform()=%s", {strings[platform()]} ), "Information", MB_OK )
The command-line eui print_platform.ex does what is expected but eubind -con print_platform.ex creates an executable that displays platform()=DOS32 !
20. Re: message_box() with eui=OK, after bind = not OK
- Posted by mattlewis (admin) Aug 16, 2010
- 1211 views
The command-line eui print_platform.ex does what is expected but eubind -con print_platform.ex creates an executable that displays platform()=DOS32 !
The comment in the backend code indicates "unknown platform," which tells me that the build process for eub.exe isn't correct. I wonder if that should be changed to 0 or -1 or something that's obviously wrong. Somehow, it's not passing /dEWINDOWS in the back end C flags.
Matt
21. Re: message_box() with eui=OK, after bind = not OK
- Posted by SPringle Aug 16, 2010
- 1183 views
One part of the problem lies in emit.e line 1688 to 1692:
-- front end knows platform n = host_platform() if n <= WIN32 and BIND then n = 1 + con -- set platform value based on bind option, so -- eubw.exe bind.il can serve Console or Windowed end if
According to the comments, platform is used as a kludge by the backend to tell bind whether to operate like a console application or a windowing application. Thus if you remove these offending condition lines, all of your apps will not use the existing console. Now, if this is true, why do we have two backends in Windows? I think we should remove that branch there and fix what ever breaks because of it.
Shawn Pringle
22. Re: message_box() with eui=OK, after bind = not OK
- Posted by jimcbrown (admin) Aug 16, 2010
- 1160 views
According to the comments, platform is used as a kludge by the backend to tell bind whether to operate like a console application or a windowing application. Thus if you remove these offending condition lines, all of your apps will not use the existing console. Now, if this is true
If this was ever true, it no longer is. This branch is clearly obsolete.
Likely, it refers to a hack that allowed the DOS ex.exe to run bind.ex but create executables for either DOS32 or WIN32 (or vice versa).
I think we should remove that branch there and fix what ever breaks because of it.
Shawn Pringle
Agreed.