I was having some trouble testing some code in the emulator that worked well on my E-200, so I decided to track down the problem. After an hour or so of hunting, I finally got it down to a problem registering the window class.
Here is the scenario: I have a class wrapper for a window. In that class wrapper are funtions to register and create the window, as well as a static wndproc. On creation, I use setwindowlong to put a pointer to the specific class in its windows GWL_USERDATA. Then, in the wndproc, I get the GWL_USERDATA, cast it as a pointer to my class, and send the messages through to another function in the class that isn't shared.
I had two separate projects that I was using to play around with this. The first time I tried it, it worked great on both the emulator and the PPC. The second time I tried it, I found that I had to register the window class with a NULL wndproc and then use setwindowlong to set the GWL_WNDPROC to point to my static wndproc after I had created the window.
Every time I tried to create a window with the wndproc set when I registered the class, the program would kill itself when I called createwindow. It doesn't do this in the first project.
I have no idea what could be happening. Thoughts?