Author Topic: Problem with windows.inc  (Read 253 times)

absolutzero

  • Regular Member
  • *
  • Posts: 3
Problem with windows.inc
« on: September 02, 2021, 12:41:06 AM »
I d like to thank for masm32 project, especially for unicode support. But I found problems with windows.inc, which causes errors in assembling.

First problem is in DRAWTEXTPARAMS STRUCT. There is item iTabiLength, but Microsoft defines it iTabLength.

Also I have problem with lfFaceName WORD LF_FACESIZE dup (?) item in LOGFONTW structure in unicode project. I changed it to: lfFaceName BYTE LF_FULLFACESIZE. I dont know, if it is syntactically right, but it works.

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 8497
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Problem with windows.inc
« Reply #1 on: September 02, 2021, 07:44:49 AM »
Its likely to be a typo from long ago and changing it is the right response.The file was produced back when the reference material was very hard to find and while most of the errors were fixed long ago, you still get the odd quirk that has been missed.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

rsala

  • Member
  • ***
  • Posts: 331
    • Easy Code
Re: Problem with windows.inc
« Reply #2 on: September 02, 2021, 07:31:12 PM »
Hi,

For the UNICODE version (LOGFONTW), the lfFaceName member must be "lfFaceName WORD LF_FULLFACESIZE dup (?)". "lfFaceName BYTE LF_FULLFACESIZE" is for the ANSI version (LOGFONTA).
EC coder

absolutzero

  • Regular Member
  • *
  • Posts: 3
Re: Problem with windows.inc
« Reply #3 on: September 04, 2021, 12:47:29 AM »
Thanks for replies. I played with LOGFONTW again and it seems, that its declaration in windows.inc is ok. Problem is rather in its initialisation:

.data
logfnt          LOGFONT <-13,0,0,0,FW_NORMAL,0,0,0,DEFAULT_CHARSET,3,2,1,49,"Lucida Console">

My fix lfFaceName BYTE LF_FULLFACESIZE is assembled without errors, but font name is compiled as ANSI, not UNICODE string. I dont know, how to initialise this structure. I think the best solution of this is move structure to unitialised data section and initialise it at runtime:

.data?
logfnt          LOGFONT <>


Biterider

  • Member
  • ****
  • Posts: 725
  • ObjAsm Developer
    • ObjAsm
Re: Problem with windows.inc
« Reply #4 on: September 04, 2021, 02:36:05 AM »
Hi
Try this

Code: [Select]
.data
logfnt          LOGFONT <-13,0,0,0,FW_NORMAL,0,0,0,DEFAULT_CHARSET,3,2,1,49,{"L","u","c","i","d","a"," ","C","o","n","s","o","l","e",0}>

Biterider

TouEnMasm

  • Member
  • *****
  • Posts: 1805
    • EditMasm
Re: Problem with windows.inc
« Reply #5 on: September 04, 2021, 02:56:42 AM »
Fa is a musical note to play with CL

absolutzero

  • Regular Member
  • *
  • Posts: 3
Re: Problem with windows.inc
« Reply #6 on: September 05, 2021, 12:07:02 AM »
Biterider thank you, it works.