Why can't I inicialize fields of structures with OFFSET ? For example:



(...)

.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
Posted on 2004-09-05 19:53:27 by Marginais
it's not a declaration or anything, it's an asm directive, you gotta do it after you define some variable as WNDCLASSEX
Posted on 2004-09-05 22:52:39 by Drocon
create a prototype of the wndproc above the struc definition
Posted on 2004-09-05 23:31:20 by wizzra
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.
Posted on 2004-09-06 00:59:44 by Black iCE