the currect windows.inc struct im having problems with looks like this.
NMRBAUTOSIZE STRUCT
  hdr       NMHDR      <>
  fChanged  DWORD      ?
  rcTarget  RECT       <>
  rcActual  RECT       <>
NMRBAUTOSIZE ENDS
i convert it to this but i get redefinition errors.
NMRBAUTOSIZE STRUCT
STRUCT
  hwndFrom  DWORD       ?
  idFrom    DWORD       ?
  code      DWORD       ?
ENDS
  fChanged  DWORD       ?
STRUCT
  left      dd          ?
  top       dd          ?
  right     dd          ?
  bottom    dd          ?
ENDS
STRUCT
  left      dd          ?
  top       dd          ?
  right     dd          ?
  bottom    dd          ?
ENDS
NMRBAUTOSIZE ENDS
the problem is i have 2 structures that are exactly the same. i need to know how i can name them or change them somehow so i dont get the errors. of course it needs to work properly after the modifications. i tried using changing it to:
NMRBAUTOSIZE STRUCT
STRUCT
  hwndFrom  DWORD       ?
  idFrom    DWORD       ?
  code      DWORD       ?
ENDS
  fChanged  DWORD       ?
@tag_1 STRUCT
  left      dd          ?
  top       dd          ?
  right     dd          ?
  bottom    dd          ?
@tag_1 ENDS
@tag_2 STRUCT
  left      dd          ?
  top       dd          ?
  right     dd          ?
  bottom    dd          ?
@tag2 ENDS
NMRBAUTOSIZE ENDS
but i still get errors. thanks smurf This message was edited by smurf, on 5/4/2001 1:20:05 AM This message was edited by smurf, on 5/4/2001 2:10:19 AM
Posted on 2001-05-04 01:06:00 by smurf
It doesn't work like that, but you already noticed :rolleyes: Inside a structure, you can't place another STRUCT. This isn't needed because you can do any data declartion in the first struct. Anyway, this how the structure is accessed as in windows.inc: (say you declared
mystruct   NMBRAUTOSIZE 
)

mystruct.hdr.hwndFrom
mystruct.hdr.idFrom
mystruct.hdr.code
mystruct.fChanged
mystruct.rcTarget.left
mystruct.rcTarget.top
mystruct.rcTarget.right
mystruct.rcTarget.bottom
mystruct.rcActual.left
mystruct.rcActual.top
mystruct.rcActual.right
mystruct.rcActual.bottom
Study that, and you'll understand how to make what you're trying to do work.
Posted on 2001-05-04 06:38:00 by Qweerdy
Smurf, The main structure below looks OK, the trick is how to expand it in your code.

    NMRBAUTOSIZE STRUCT
      hdr       NMHDR      <>
      fChanged  DWORD      ?
      rcTarget  RECT       <>
      rcActual  RECT       <>
    NMRBAUTOSIZE ENDS
In a proc,

    LOCAL nas:NMRBAUTOSIZE

    mov nas.hdr.hwndFrom,    0
    mov nas.hdr.idFrom,      0
    mov nas.hdr.code,        0
    mov nas.fChanged,        0
    mov nas.rcTarget.left,   0
    mov nas.rcTarget.top,    0
    mov nas.rcTarget.right,  0
    mov nas.rcTarget.bottom, 0
    mov nas.rcActual.left,   0
    mov nas.rcActual.top,    0
    mov nas.rcActual.right,  0
    mov nas.rcActual.bottom, 0
This is the fully expanded form of the structure initialised to zero, if you need to put memory operands into the members, you will have to either use a register for each one or use push/pop. Regards, hutch@pbq.com.au
Posted on 2001-05-04 07:01:00 by hutch--
thanks Qweerdy and Hutch that clears it up for me. smurf
Posted on 2001-05-04 07:21:00 by smurf