I'm going through the examples in Petzold's Programming Windows Fifth Edition, to familiarize myself with Winelib and to test against Wine 20050111. I am also comparing the output against Visual C++ 6.0 compilation on Windows XP.
I finished Section 1 (Chapters 1-12) and found the following differences. (I didn't want to report these as bugs until others verified them, as well as my approach.) I have the source and can narrow down the code if you think this is necessary.
I will proceed to Section 2 and report when I'm finished.
Ira --------------------------------------------
Chapter 3: HelloWin.c Could not compile because PlaySoundA was not found.
Chapter 5: SineWave.c at runtime, after sine wave displays OK and window is dismissed, get messages: err:dc:DCE_FreeWindowDCE [0x50030] GetDC() without ReleaseDC! I rerun and get a variable number of the messages, and the address inside the brackets [] changes.
Clover.c Draws the clover regions initially OK, but does not redraw when the user resizes the window. Note: The resizing works in Windows XP when compiled with Visual C++ 6.0.
Chapter 8: WhatClr.c Compiles and runs, but doesn't display the correct colors all the time. For example, if the cursor is under the black letters, doesn't display FF FF FF but pulsates. ALso displays FF FF FF when on a white pixel, when it should be 00 00 00.
Chapter 9: PopPad1.c Compiles and runs and works for the most part. However, if you start typing on line 1 and keep typing to beyond the end of the line, the text redisplays at the bottom. In Windows, it keeps displaying on the same line and scrolls.
Head.c Compiler warning on passing NULLto ReadFile: head.c:179 warning: passing arg 4 of 'ReadFile' from incompatible pointer type. But runs OK.
Chapter 10: IconDemo.c Resource compiler warning: In non MFC projects, winemaker replaces the MFC specific header 'afxres.h' with 'winres.h'. Icon resource compiles OK and program runs OK.
PoePoem.c Compiles OK. Exception raised dialog: "Unhandled page fault on write access to 0x7637f17a at address 0x7637e592. Do you wish to debug it?" Goes into Winedbg if you click Yes.
PoorMenu.c Compiles and runs. However, it doesn't add the additional menu choices to the System Menu.
NoPopup.c Compiles and runs. However, does not display all the menu choices if you double click the File.. choice. Should have New, Open, Save, Save As, and Main. The choices are there but hidden - need to click on each choice. The Main item, when clicked, should restore the MAIN menu but does not do so. Compare with Windows version.
Chapter 11: About3.c OK, except that the custom icon (III) does not replace the down arrow in the upper left corner of the window, which it does in the Windows version.
HexCalc.c Compiles and calculates OK. The button display is rectangular (long and narrow). On Windows the buttons display square.
PopAd3.c OK. Produces message: fixme:commdlg:GetFileName95 Flags 0x00002000 not yet implemented when invoking the File Open dialog but otherwise works fine.
Chapter 12: ClipView.c Compiles and runs but does not update the clipboard when the clipboard contents changes. Run ClipText under Wine, copy or cut the text to the clipboard, ClipView does not see the clipboard contents. -----------------------------------------------------
On Mon, 24 Jan 2005, Ira Krakow wrote: [...]
Chapter 3: HelloWin.c Could not compile because PlaySoundA was not found.
That's because winemaker does not know that HelloWin needs to be linked with winmm.dll. So you need to edit the Makefile to add 'winmm' to 'hellowin_exe_DLLS'.
Chapter 5: SineWave.c at runtime, after sine wave displays OK and window is dismissed, get messages: err:dc:DCE_FreeWindowDCE [0x50030] GetDC() without ReleaseDC! I rerun and get a variable number of the messages, and the address inside the brackets [] changes.
This is a bug in the sample. You need to apply the Fifth edition's Errata: http://www.charlespetzold.com/pw5/pw5faq.html
Clover.c Draws the clover regions initially OK, but does not redraw when the user resizes the window. Note: The resizing works in Windows XP when compiled with Visual C++ 6.0.
Interesting. It seems to correspond to what I noticed ages ago: http://fgouget.free.fr/wine/PrgWin98/Chap5.shtml#Clover
I don't remember the other issues but some seem to correspond to issues I had noticed: http://fgouget.free.fr/wine/PrgWin98/index.shtml
Does it mean that Wine did not make that much progress in all this time? :-(
Francois,
Does it mean that Wine did not make that much progress in all this time? :-(
No, it just points out the need for defining and running regression tests. There are so many interdependencies that it's too easy for one fix to unfix a lot of other stuff.
That's why the Codeweaver's Visual Regression Test tool (www.cxtest.org) is extremely important.
Ira
Francois,
That's because winemaker does not know that HelloWin needs to be linked with winmm.dll. So you need to edit the Makefile to add 'winmm' to 'hellowin_exe_DLLS'.
Worked!
SineWave.c
This is a bug in the sample. You need to apply the Fifth edition's Errata: http://www.charlespetzold.com/pw5/pw5faq.html
Added the EndPaint, recompiled, and reran. Message went away - worked as well.
Thanks. Ira
On Mon, 2005-01-24 at 11:38 -0800, Ira Krakow wrote:
Chapter 9: PopPad1.c Compiles and runs and works for the most part. However, if you start typing on line 1 and keep typing to beyond the end of the line, the text redisplays at the bottom. In Windows, it keeps displaying on the same line and scrolls.
This bug has been fixed on January 17th 2005.
See http://www.winehq.org/hypermail/wine-cvs/2005/01/0412.html