Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!rpi!uupsi!grebyn!ted From: ted@grebyn.com (Ted Holden) Newsgroups: comp.lang.c++ Subject: Petzold's Windows examples with Zortech 2.1 Message-ID: <1991Mar6.130447.16332@grebyn.com> Date: 6 Mar 91 13:04:47 GMT Organization: Grebyn Corporation Lines: 48 Maybe Walter Bright or someone could answer this; the guys on the tech line at Zortech couldn't. In Petzold's book "Programming Windows", which is pretty much the standard book on the topic, the standard section of code for setting up a window class (at least in one case) reads: if (!hPrevInstance) { zwndclass.style = CS_HREDRAW | CS_VREDRAW ; zwndclass.lpfnWndProc = WndProc ; zwndclass.cbClsExtra = 0 ; zwndclass.cbWndExtra = 0 ; zwndclass.hInstance = hInstance ; zwndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION) ; zwndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ; zwndclass.hbrBackground = GetStockObject (WHITE_BRUSH) ; zwndclass.lpszMenuName = NULL ; zwndclass.lpszClassName = szAppName ; RegisterClass (&zwndclass) ; } and this won't compile under Zortech 2.1. The function name WndProc must be typecast to void, i.e. the 2'nd line zwndclass.lpfnWndProc = WndProc ; must be changed to zwndclass.lpfnWndProc = (void *) WndProc ; and then the whole thing works with Zortech 2.1. Nothing in windows.h would seem to suggest such a requirement. What gives?? Ted Holden HTE