Euphoria Ticket #598: Windows XP message box does not work on its own

A program which issues message boxes with no conventional graphical user interface and has worked on previous versions of Euphoria does not now produce any output unless a suitable DLL is opened. The following program opens a suitable DLL and works. However, if the open_dll statement is commented out it does not produce a message box.

include std\dll.e 
open_dll("comdlg32.dll")  -- or "EuWinGUI.DLL" or "libwxeu.dll" or "Graphics.dll" 
include std\win32\msgbox.e 
message_box("Trying\nmessage_box","Trial",MB_OK) 

I am using Euphoria version 4.0.0

The DLL doesn't even need to be used and most DLLs do not make it work.

I realise that my Windows XP system has also changed, so could someone else with an up-to-date Windows XP system try it and see if it gives similar results?

Details

Type: Bug Report Severity: Normal Category: Interpreter
Assigned To: mattlewis Status: Fixed Reported Release: 4.0.0
Fixed in SVN #: View VCS: none Milestone: 4.0.1

1. Comment by Insolor Feb 02, 2011

WinXP Pro SP3 Eu4

Such code

include std\win32\msgbox.e  
message_box("Trying\nmessage_box","Trial",MB_OK)  

successfully produces a message box

2. Comment by ArthurCrump Feb 02, 2011

Thank you, Insolar. I suppose that means there must be a problem with my WIndows software rather than Euphoria.

3. Comment by ArthurCrump Feb 05, 2011

I have tried reinstalling various versions of Euphoria.
After installing from euphoria-v4.0.0.RC1.exe and some earlier beta versions the following code produces a message box, as expected.

include std\win32\msgbox.e 
message_box("Trying\nmessage_box","Trial",MB_OK) 

However, After installing from euphoria-v4.0.0.RC2.exe or from the final release, the message box does not appear unless one of a few DLL files is opened; for example: comctl.dll

Insolar, Which release of Euphoria are you running?

4. Comment by LarryMiller Feb 07, 2011

My system also shows the problem described here. This is with XP SP3 and using the official release of Euphoria 4. The message_box() function returns zero and getLastError() returns 1411 "Class does not exist."

I have never experienced this problem is a real application, only in the sample program above.

5. Comment by ArthurCrump Feb 07, 2011

Larry Miller's GetLastError returned 1411 but mine returned 0.
I have modified the supplied demo\sanity.ex to test for WINDOWS and GUI instead of WIN32 and WIN32_GUI and tried it. It should produce two message boxes but neither of them appears unless a suitable DLL is opened. In fact I opened it and closed it again with the code below and the message boxes appeared.

atom comdlg = open_dll("ComDlg32.DLL") 
atom k32 = open_dll("kernel32.dll") 
atom freeDLL = define_c_func(k32,"FreeLibrary",{C_UINT},C_UINT) 
if c_func(freeDLL,{comdlg}) = 0 and 1/0 then end if 

6. Comment by ArthurCrump Feb 15, 2011

When the original two line program

include std\win32\msgbox.e  
message_box("Trying\nmessage_box","Trial",MB_OK) 

is run with eui or shrouded and run with eubw no message box appears.
However, when it is translated using Watcom the message box appears.
Getting the correct behaviour only when translated appears to be similar to the forum topic "win32lib problem reported by ChrisB.

7. Comment by mattlewis Feb 16, 2011

The issue appears to be that euphoria is now built with a manifest that allows euphoria programs to display XP (or maybe later?) style controls. The manifest affects which common controls are used (since that's how Microsoft implemented the different styling). So if comdlg32.dll isn't loaded, then windows doesn't seem to want to show the message box (possibly any other GUI elements, too).

So I think the fix is to ensure that we load comdlg32.dll. The best way to solve this for users is probably to link that library when we build euphoria. Alternatively, we could simply document this (big libraries like win32lib will already load it) and add the dll to msgbox.e.

8. Comment by mattlewis Feb 16, 2011

See: hg:euphoria/rev/287d125e63e9

changeset: 4649:287d125e63e9 branch: 4.0 parent: 4647:956630cfb498 user: Matt Lewis date: Wed Feb 16 08:28:05 2011 -0500 files: source/Makefile.wat source/be_runtime.c source/buildsys.e description:

9. Comment by mattlewis Feb 16, 2011

See: hg:euphoria/rev/a5a74107d085

changeset: 4650:a5a74107d085 parent: 4648:36bec9d87d64 parent: 4649:287d125e63e9 user: Matt Lewis date: Wed Feb 16 08:28:46 2011 -0500 files: source/Makefile.wat source/be_runtime.c source/buildsys.e description:

  • merge fix for ticket 598 into trunk

10. Comment by mattlewis Feb 16, 2011

See: hg:euphoria/rev/3c861d002bae

changeset: 4651:3c861d002bae branch: 4.0 parent: 4649:287d125e63e9 user: Matt Lewis date: Wed Feb 16 08:31:15 2011 -0500 files: docs/release/4.0.1.txt description:

  • release notes for ticket 598

11. Comment by mattlewis Feb 16, 2011

See: hg:euphoria/rev/e1a990d24160

changeset: 4652:e1a990d24160 tag: tip parent: 4650:a5a74107d085 parent: 4651:3c861d002bae user: Matt Lewis date: Wed Feb 16 08:35:14 2011 -0500 files: docs/release/4.0.1.txt description:

  • merge release notes for ticket 598

Search



Quick Links

User menu

Not signed in.

Misc Menu