Petzold's Programming Windows ... I thought the examples should just work
Petzold uses a microsoft compiler and the examples are old. Borland's bcc5.5.1 is also old; consider getting something more recent if that's an option for you.
That aside, with the #inclusion of the resource script in the source code file, bcc32 (bcc551's compiler) is trying and failing to parse it; it needs to be compiled separately to a resource object with brcc32(the resource compiler) and linked with the compiled source object.
In short, remove the #include "hexcalc.dlg" line and follow the other advice already given in this thread: ensure that WndProc is forward declared, fix the comment and remove #include <windows.h> from hexcalc.dlg. Then compile the resource script with brcc32, compile the hexcalc.c with brc32 and link the objects with ilink32 using appropriate flags as described in the documentation. eg compile corrected resource:
Code:
brcc32 -fo hexcalc.res hexcalc.dlg
then compile modified source:and complete by linking compiled objects into final executable:
Code:
ilink32 -aa c0w32.obj hexcalc.obj,hexcalc.exe,,import32.lib cw32.lib,,hexcalc.res