The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: aleksazr on August 20, 2009, 08:09:12 AM

Title: Nested, named structures
Post by: aleksazr on August 20, 2009, 08:09:12 AM
WINDOW struct
  struct win
    handle HANDLE ?
  ends
WINDOW ends

mainwin WINDOW <>

1. mov eax,[mainwin].handle
2. mov eax,[mainwin].win.handle

Both [1] and [2] will work (and access the same field).

What can I do to make masm acccept only [2] and produce
an error (eg. 'variable not found') on [1]?


Is there another way (switch?), except this:

WIN struct
  handle HANDLE ?
ends

WINDOW struct
  win WIN <>
WINDOW ends
Title: Re: Nested, named structures
Post by: dedndave on August 20, 2009, 09:00:35 AM
QuoteWIN struct
  handle HANDLE ?
ends

WINDOW struct
  win WIN <>
WINDOW ends
that is how to do it