Why can't I inicialize fields of structures with OFFSET ? For example:
TASM shows the message "Illegal forward reference" before compiling. Is there any way to make it be accepted ? Thanks
(...)
.DATA
WNDCLASSEX STRUC
cbSize DD ?
style DD ?
lpfnWndProc DD OFFSET WNDPROC
cbClsExtra DD ?
cbWndExtra DD ?
hInstance DD ?
hIcon DD ?
hCursor DD ?
hbrBackground DD ?
lpszMenuName DD ?
lpszClassName DD ?
hIconSm DD ?
WNDCLASSEX ENDS
.CODE
(...)
TASM shows the message "Illegal forward reference" before compiling. Is there any way to make it be accepted ? Thanks
it's not a declaration or anything, it's an asm directive, you gotta do it after you define some variable as WNDCLASSEX
create a prototype of the wndproc above the struc definition
I am with wizzra on this 1. Prototype the Window Procedure. But OFFSET works according to unique name and not a TYPE WNDPROC, unless you are calling your widow procedure WNDPROC.