News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

TV_ITEM structure

Started by diablo2oo2, October 03, 2006, 10:09:43 PM

Previous topic - Next topic

diablo2oo2

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  ?
...

drizz

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.
The truth cannot be learned ... it can only be recognized.

Shantanu Gadgil

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
To ret is human, to jmp divine!

hutch--

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.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

alksentrs

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.

hutch--

alksentrs,

That is a good idea, I will have to think about it to make sure there are no side effects.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

sinsi

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?)?
Light travels faster than sound, that's why some people seem bright until you hear them.

Shantanu Gadgil

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
To ret is human, to jmp divine!

sinsi

CTRL+H ? Is that...Notepad? Too advanced for me, I prefer to use EDIT.COM. Ah, bring back DOS.  :bdg
Light travels faster than sound, that's why some people seem bright until you hear them.