Hi,
I have a little problem with DialogBoxParam.
Ok... may be i will post some code and after describe my problem.


That code work
RC
  CONTROL "List",IDC_LSV1,"SysListView32",WS_VISIBLE|WS_BORDER|WS_TABSTOP|!!!!!LVS_LIST!!!!!!,0,39,681,258,WS_EX_CLIENTEDGE


ASM
invoke DialogBoxParam, ,1000,0,DialogMain,0


proc DialogMain;hDlg=rcx uMsg=rdx wParam=r8 lParam= r9
mov , rcx
    cmp rdx, WM_INITDIALOG
    jne _@@
    invoke GetDlgItem,,1003
    mov , rax
_@@:


That don't


RC
  CONTROL "List",IDC_LSV1,"SysListView32",WS_VISIBLE|WS_BORDER|WS_TABSTOP|!!!!!LVS_REPORT!!!!!,0,39,681,258,WS_EX_CLIENTEDGE


ASM
invoke DialogBoxParam, ,1000,0,DialogMain,0


proc DialogMain;hDlg=rcx uMsg=rdx wParam=r8 lParam= r9
mov , rcx
    cmp rdx, WM_INITDIALOG
    jne _@@
    invoke GetDlgItem,,1003
    mov , rax
    invoke SendMessage, , LVM_INSERTCOLUMN, 0,offset kolumna
_@@:


data:

    NASMX_ISTRUC kolumna, LV_COLUMN
    NASMX_AT imask, LVCF_TEXT+LVCF_WIDTH+LVCF_SUBITEM
    NASMX_AT fmt, NULL
    NASMX_AT lx, 100
    NASMX_AT pszText, "name"
    NASMX_AT cchTextMax, NULL
    NASMX_AT iSubItem, NULL
    NASMX_IENDSTRUC


Lang: nasm with nasmx
rc link: go
platform: win 7 x64

Program will compile. Difference is only in rc file. In second situation I add insert column but without too don't work.
In second option program have problem after dialogboxparam execute.

any suggestion ?

Greets
Posted on 2010-09-07 10:17:56 by Duracell
Hello Duracell,

Two quick suggestions:
I see you're using the newer NASMX syntax which is cool.  In defining the structure are you instantiating by initializing all struc fields?  There is a %fatal that occurs which I used for debugging that didn't get removed when I packaged up v1.0b3 but will be taken care of in the next beta.  The fix is already available on source forge if you care to download.

Secondly, NASMX in it's current state does not really play nice with 64-bit Windows and is next on my TODO list.  Modify your code by placing the function params into the appropriate registers (RCX, RDX, R8, R9) and call function

Please note that you should also establish a Register Shadow Storage space within the caller to ensure the called function operates properly.  It's easiest to do this by simply:

sub rsp, 32
call function
add rsp, 32


Any functions that take more than 4 parameters must be placed above this area so you may wish to push reg prior to modifying the stack pointer. The next beta release of NASMX will take care of things like this automatically.  Let me know if that works for you.

Posted on 2010-09-07 14:27:31 by p1ranha
It helped. One kind of the way. I trusted too much in nasmx.

After when I start coding in x64 I was looking for more comfortable sdk (writing more then 4 line of code for one function is horrible xD). Nasmx is actually the better. My congratulation for new leader :P

And what will i do witk sendmessage ? sub sizeof column struct ?


P.S. are structs good implemented for x64 for win?
Posted on 2010-09-07 15:49:45 by Duracell
Defining your own struc's are fine.  Using the windows.inc struc's as currently defined may/may not work in x64 due to pointer size differences.  In your particular case you must modify the windows.inc LV_COLUMN struc definition by changing the pszText field from:


    NASMX_RESERVE pszText, int32_t, 1


to


    NASMX_RESERVE pszText, NASMX_PTR, 1


I simply have not had time to go through every definition and update to the appropriate sizes yet.  I'm currently developing a tool to help me do that but in the meantime I would advise you to double-check the definitions against the actual SDK headers.

After looking at the SDK help I also realized that you filled in the struct field cchTextMax incorrectly.  That field contains the size of TCHAR's pointed to by pszText, thus in your case you have told windows that there are no chars contained in the buffer, something I'm sure you did not intend.

Hope this helps...

Posted on 2010-09-08 12:50:42 by p1ranha
I was trying use  cchtextmax earlier. Changing reserved value too. That isn't that way.
Any suggestion for that?
Posted on 2010-09-09 01:42:58 by Duracell
cchtextmax is only used when READING items from the listview - it is ignored when WRITING them, so no problem using cchtextmax=0

Posted on 2010-09-09 06:17:55 by Homer
does anyone have any idea what is wrong or what i should add to this?
Posted on 2010-09-15 03:33:24 by Duracell
Duracell,

Zip up your source code and either attach it to your reply here or email it to me and I'll take a look at it.  Please do not send me any binaries, source files only.
Posted on 2010-09-15 06:19:27 by p1ranha
Problem is with sendmessage. I think that is problem.
Attachments:
Posted on 2010-09-15 07:12:13 by Duracell
sig link builder alert!  :roll: :roll: :roll:
Posted on 2010-09-22 11:59:21 by p1ranha
Some info about it?

Are u looking in disasm code? I'll try find errors in fdbg. Declaration of function look correctly.
Builder alert will be well-seen.
Posted on 2010-09-22 12:30:32 by Duracell