DMD calling incorrect method

Tyler Knott Tyler_member at pathlink.com
Thu Mar 2 18:49:57 PST 2006


Test case (source + make file (mt2.bat) + compiled Win32 binary):
http://webpages.charter.net/tknott/guitest2.zip (977K)

This newsgroup seemed most appropriate for this problem.  I'm working on a GUI
frontend to a small C program (which I ported to a D class) in DWT and some
methods in certain classes (dwt.widget.Button.setBounds, dwt.widget.Combo.add,
and dwt.widget.Button.setText are the ones I've encoutered so far) always result
in bizarre errors or access violations.  I've just been working around them up
to this point, but when I couldn't get around it any longer I looked at what the
code was doing in a debugger.  It seems that DMD is using an incorrect offset
while calling the setText method for my settingsButton object and calling the
setImage method for it instead(!).  To check for yourself run "guitest2.exe"
(from the linked zip file) in a debugger, set a breakpoint at 0x00404052, then
look at what method (edx+0x4e8) points to when that breakpoint is reached.  I'm
using DMD 0.148 with DWT 0.36-20060228 and Build v2.9(1197)(Aug 10, 2005) on
Windows XP Home SP2, though this also happened with DMD 0.145 and DWT
0.35-20060203 (yes, I did replace the 0.35 DWT .lib and import files with 0.36
ones before compiling the test case).  This doesn't always happen:  the
controlexample example included with DWT compiles and runs just fine.





More information about the Digitalmars-d-bugs mailing list