flat assembler
Message board for the users of flat assembler.

flat assembler > Windows > [solved] PRINTDLG struct size (64 bit)

Author
Thread Post new topic Reply to topic
WereMole



Joined: 28 May 2016
Posts: 5
I am using flat assembler 1.72

I was working on a bigger program (64bit) and could not get the printdlg box to appear. To simplify things I copied the "examples win64 template" and modified it so a left click on the mouse would call the dialog box.

I added 3 items to the data section

msg MSG
hinstance dq ?
hwnd_main dq ?
pd PRINTDLG

In addition comdlg32 was added to the library and includes

user32,'USER32.DLL',\
comdlg32,'COMDLG32.DLL'

include 'api\kernel32.inc'
include 'api\user32.inc'
include 'api\comdlg32.inc'

Following the windows 32bit example the data structure was loaded with data making sure the larger operands were used where required.

Here is the problem:

The first value in the data structure is the size of the structure. If I use sizeof.PRINTDLG to load pd.lStructureSize then this value is loaded with 74h and the printer dialog box fails to appear.

However, if pd.lStructureSize is set to 78h the dialog box appears.

What am I doing wrong? How should one fix this problem?
Post 15 Nov 2017, 16:13
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16098
Location: Transylbonia
I suspect the dialog definition is wrong. Tomasz will have to fix it, or you can manually modify it yourself.

After this line:
Code:
  lCustData           dd ?    
there probably should be some padding to align the following dq values correctly. The easiest might be to simply add one more question mark.
Code:
  lCustData           dd ?,?    
I've marked this topic as a bug.
Post 15 Nov 2017, 16:29
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 6981
Location: Kraków, Poland
I have updated the Windows package.
Post 15 Nov 2017, 16:48
View user's profile Send private message Visit poster's website Reply with quote
WereMole



Joined: 28 May 2016
Posts: 5
Thank you
Post 15 Nov 2017, 17:46
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2018, Tomasz Grysztar.

Powered by rwasa.