Author Topic: Constant Names Used But Not Defined  (Read 4328 times)

dedndave

  • Member
  • *****
  • Posts: 8752
  • Still using Abacus 2.0
    • DednDave
Constant Names Used But Not Defined
« 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

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)

guga

  • Member
  • ****
  • Posts: 826
  • Assembly is a state of art.
    • RosAsm
Re: Constant Names Used But Not Defined
« Reply #1 on: September 10, 2014, 05:08:51 AM »
 :t
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

Gunther

  • Member
  • *****
  • Posts: 3518
  • Forgive your enemies, but never forget their names
Re: Constant Names Used But Not Defined
« Reply #2 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
Get your facts first, and then you can distort them.

dedndave

  • Member
  • *****
  • Posts: 8752
  • Still using Abacus 2.0
    • DednDave
Re: Constant Names Used But Not Defined
« Reply #3 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

MichaelW

  • Global Moderator
  • Member
  • *****
  • Posts: 1209
Re: Constant Names Used But Not Defined
« Reply #4 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.
« Last Edit: September 10, 2014, 03:47:16 PM by MichaelW »
Well Microsoft, here’s another nice mess you’ve gotten us into.

Gunther

  • Member
  • *****
  • Posts: 3518
  • Forgive your enemies, but never forget their names
Re: Constant Names Used But Not Defined
« Reply #5 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
Get your facts first, and then you can distort them.

dedndave

  • Member
  • *****
  • Posts: 8752
  • Still using Abacus 2.0
    • DednDave
Re: Constant Names Used But Not Defined
« Reply #6 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

Gunther

  • Member
  • *****
  • Posts: 3518
  • Forgive your enemies, but never forget their names
Re: Constant Names Used But Not Defined
« Reply #7 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
Get your facts first, and then you can distort them.

dedndave

  • Member
  • *****
  • Posts: 8752
  • Still using Abacus 2.0
    • DednDave
Re: Constant Names Used But Not Defined
« Reply #8 on: September 11, 2014, 06:49:44 AM »
i commented them out   :P

Gunther

  • Member
  • *****
  • Posts: 3518
  • Forgive your enemies, but never forget their names
Re: Constant Names Used But Not Defined
« Reply #9 on: September 11, 2014, 10:24:27 PM »
Get your facts first, and then you can distort them.

ToutEnMasm

  • Member
  • *****
  • Posts: 1189
    • EditMasm
Re: Constant Names Used But Not Defined
« Reply #10 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.


Fa is a musical note to play with CL

Gunther

  • Member
  • *****
  • Posts: 3518
  • Forgive your enemies, but never forget their names
Re: Constant Names Used But Not Defined
« Reply #11 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
Get your facts first, and then you can distort them.

ToutEnMasm

  • Member
  • *****
  • Posts: 1189
    • EditMasm
Re: Constant Names Used But Not Defined
« Reply #12 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.
Fa is a musical note to play with CL