http://bugs.winehq.org/show_bug.cgi?id=24522
--- Comment #5 from Alexandre Julliard julliard@winehq.org 2010-09-26 16:37:22 CDT --- CreateCompatibleDC(NULL) is OK, and works fine. It's used in many places in the Wine code.
The problem is that a tiny sample app like your example doesn't import user32, which is thus not initialized properly. It's arguably a bug, but not something that's going to happen with any real app.