The MASM Forum

Projects => MASM32 => WINDOWS.INC Project => Topic started by: dedndave on September 09, 2014, 11:43:58 PM

Title: Constant Names Used But Not Defined
Post by: dedndave on September 09, 2014, 11:43:58 PM
in discussion of window class names, i came across a group of constant names used that are not defined

http://masm32.com/board/index.php?topic=3584.0 (http://masm32.com/board/index.php?topic=3584.0)

about 3/4 of the way down windows.inc...

Code: [Select]
LPNMDATETIMESTRING               equ LPNMDATETIMESTRINGA
LPNMDATETIMEWMKEYDOWN            equ LPNMDATETIMEWMKEYDOWNA
LPNMDATETIMEFORMAT               equ LPNMDATETIMEFORMATA
LPNMDATETIMEFORMATQUERY          equ LPNMDATETIMEFORMATQUERYA
WC_PAGESCROLLER                  equ WC_PAGESCROLLERA

the right-hand side constants are not previously defined (nor are their W counterparts)
Title: Re: Constant Names Used But Not Defined
Post by: guga on September 10, 2014, 05:08:51 AM
 :t
Title: Re: Constant Names Used But Not Defined
Post by: Gunther on September 10, 2014, 05:55:04 AM
Hi Dave,

Code: [Select]
LPNMDATETIMESTRING               equ LPNMDATETIMESTRINGA
LPNMDATETIMEWMKEYDOWN            equ LPNMDATETIMEWMKEYDOWNA
LPNMDATETIMEFORMAT               equ LPNMDATETIMEFORMATA
LPNMDATETIMEFORMATQUERY          equ LPNMDATETIMEFORMATQUERYA
WC_PAGESCROLLER                  equ WC_PAGESCROLLERA

the right-hand side constants are not previously defined (nor are their W counterparts)

do you think it's a MS error or feature?  :lol:

Gunther
Title: Re: Constant Names Used But Not Defined
Post by: dedndave on September 10, 2014, 09:25:35 AM
i think it's specific to masm32 windows.inc - not MS   :P

Hutch could probably just delete these lines
but - we'll see what he does
Title: Re: Constant Names Used But Not Defined
Post by: MichaelW on September 10, 2014, 09:45:36 AM
Everything necessary to resolve those problems is in the CommCtrl.h distributed with the Windows Server 2003 SP1 PSDK that I have installed on my older system, and the same file (version 1.2) is apparently included with the Windows 7 SDK installed on my new system. The definition for each of the first four spans ~30 lines in the header file (two structures and some constants), but the last spans ~170 lines.
Title: Re: Constant Names Used But Not Defined
Post by: Gunther on September 11, 2014, 12:41:05 AM
Hi Michael,

Everything necessary to resolve those problems is in the CommCtrl.h distributed with the Windows Server 2003 SP1 PSDK that I have installed on my older system, and the same file (version 1.2) is apparently included with the Windows 7 SDK installed on my new system. The definition for each of the first four spans ~30 lines in the header file (two structures and some constants), but the last spans ~170 lines.

I think it's a time question for Hutch. May be we get an update to download and install.

Gunther
Title: Re: Constant Names Used But Not Defined
Post by: dedndave on September 11, 2014, 01:35:16 AM
obviously, it hasn't been a problem
the reason is - they are not really applicable in ASM programming
noone has used them, so it hasn't been an issue

the "LP" constants are types that could be TYPEDEF'ed as DWORD's or LPVOID's
i would probably use LPVOID anyplace they are needed
in ANSI or in UNICODE, a pointer is a pointer   :biggrin:

the WC_PAGESCROLLER constant is a system-defined window class
the constant is of little use in ASM - we need a null-terminated string

Code: [Select]
szPageScrollClass db 'SysPager',0
we could delete or comment the lines out, with little effect
Title: Re: Constant Names Used But Not Defined
Post by: Gunther on September 11, 2014, 03:51:50 AM
Dave,

we could delete or comment the lines out, with little effect

so why not. Make the changes and test it. Hutch would be quite certain about your help.

Gunther
Title: Re: Constant Names Used But Not Defined
Post by: dedndave on September 11, 2014, 06:49:44 AM
i commented them out   :P
Title: Re: Constant Names Used But Not Defined
Post by: Gunther on September 11, 2014, 10:24:27 PM
i commented them out   :P

 :t

Gunther
Title: Re: Constant Names Used But Not Defined
Post by: ToutEnMasm on September 19, 2014, 06:14:51 PM

Only cl is able to generate the needed code for those constants.
For example:
Quote
invoke function,LPNMDATETIMESTRING
is replace by:
lea eax,NMDATETIMESTRING
push eax
call _function
ML couldn't do that and those defines are totally useless with masm.


Title: Re: Constant Names Used But Not Defined
Post by: Gunther on September 21, 2014, 07:42:07 PM
Hi ToutEnMasm,

ML couldn't do that and those defines are totally useless with masm.

is that absolutely sure?

Gunther
Title: Re: Constant Names Used But Not Defined
Post by: ToutEnMasm on September 21, 2014, 10:16:54 PM

An interesting form is in the define prototypes.
example:     Myfunction proc  :ptr RECT

You win here an interesting information and the parameter get a dword size (pointer on the RECT structure).
It's the only case where he is of some use.

To use a function you can't avoid to read the msdn help,and here is the usefull information.