The MASM Forum Archive 2004 to 2012

Project Support Forums => MASM32 => WINDOWS.INC Project => Topic started by: diablo2oo2 on October 03, 2006, 10:09:43 PM

Title: TV_ITEM structure
Post by: diablo2oo2 on October 03, 2006, 10:09:43 PM
just wonder why the TV_ITEM structure has a different name for "mask"...

in windows help file its "mask" and not "_mask"....


from windows.inc
...
TVITEMA STRUCT
  _mask             DWORD  ?
...
Title: Re: TV_ITEM structure
Post by: drizz on October 03, 2006, 11:38:45 PM
mask is masm keyword, example
lohi record hi:16,lo:16

and eax,mask lo
and edx,mask hi


imho its better to put underscore at the end, so it does not interfere with code completition
(in radasm for example), and that name relates to documentation.
i mean "mask_" matches with "mask" in four characters, but "mask" doesnt match with "_mask" in any.
Title: Re: TV_ITEM structure
Post by: Shantanu Gadgil on October 04, 2006, 02:20:51 AM
Quoteimho its better to put underscore at the end
I second that.
Also, while changing things which are keywords in ASM (like cx in some structures) there should be a standard way of modifying it, like underscore at the end, or something like that, but something standard!

Regards,
Shantanu
Title: Re: TV_ITEM structure
Post by: hutch-- on October 05, 2006, 10:14:05 AM
The leading _ is by Microsoft convention for masm reserve words and while the earlier section of windows.inc did not conform to that later standard, there is always a problem in modifying an existing structure as it breaks previous usage.
Title: Re: TV_ITEM structure
Post by: alksentrs on October 06, 2006, 11:13:22 AM
What about using a union?


TVITEMA STRUCT
  union
    _mask             DWORD  ?
    mask_             DWORD  ?
  ends
  hItem             DWORD  ?
  state             DWORD  ?
  stateMask         DWORD  ?
  pszText           DWORD  ?
  cchTextMax        DWORD  ?
  iImage            DWORD  ?
  iSelectedImage    DWORD  ?
  cChildren         DWORD  ?
  lParam            DWORD  ?
TVITEMA ENDS



Then you have the best of both worlds.
Title: Re: TV_ITEM structure
Post by: hutch-- on October 06, 2006, 11:22:38 AM
alksentrs,

That is a good idea, I will have to think about it to make sure there are no side effects.
Title: Re: TV_ITEM structure
Post by: sinsi on October 06, 2006, 11:51:21 AM
Oh no, not a bloody UNION. I can never remember how to use them. One more layer of complexity.
In what version of ML were they introduced?

And anyway, don't the versions of H2INC prefix MASM reserved words with an underscore?
If H2INC and "Microsoft convention" (oxymoron) aren't a standard, then what is (are?)?
Title: Re: TV_ITEM structure
Post by: Shantanu Gadgil on October 06, 2006, 12:57:02 PM
All I was saying was...lets just go with ONE idea, any one idea.  :bg :bg

If mask_ were to become _mask or any such thing, for me it would be a CTRL+H (or CTRL+R in RadASM  :lol ) and Replace All.

I understand the code-break headaches it would cause though.

I remember seeing a typedef for the same (I think for the POASM compatibility), not sure though, will check when I reach home!

Regards,
Shantanu
Title: Re: TV_ITEM structure
Post by: sinsi on October 06, 2006, 01:03:51 PM
CTRL+H ? Is that...Notepad? Too advanced for me, I prefer to use EDIT.COM. Ah, bring back DOS.  :bdg