flat assembler
Message board for the users of flat assembler.

Index > Windows > DragQueryFile problem

Author
Thread Post new topic Reply to topic
tangent



Joined: 21 Nov 2007
Posts: 9
tangent 21 Nov 2007, 01:35
"if ((HWND)lParam==hwnd)" becomes what?.. i noticed that all of the tutorials i've run across use dialogs when dealing with buttons, so i'm a bit stumped as to how to convert that into fasm syntax.. thanks for any help

_________________
arg


Last edited by tangent on 21 Nov 2007, 03:59; edited 1 time in total
Post 21 Nov 2007, 01:35
View user's profile Send private message AIM Address MSN Messenger Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 21 Nov 2007, 01:50
do you mean the typecast? The answer is simply, you DON'T cast.

Code:
mov eax, [hwnd]
cmp eax, [lParam]
jne .skipIfBody    
Post 21 Nov 2007, 01:50
View user's profile Send private message Reply with quote
tangent



Joined: 21 Nov 2007
Posts: 9
tangent 21 Nov 2007, 01:55
that's the stuff.. i appreciate it

*edit*
okay, now it seems i'm having a problem with DragQueryFile telling me this:
Code:
        invoke DragQueryFile,wparam,0xFFFFFFFF,szdfn,0
macro/proc32.inc [17] invoke [3]:
     pushd arg
error: invalid value.    

from szdfn rb 50.. am i missing something that should be obvious?
Post 21 Nov 2007, 01:55
View user's profile Send private message AIM Address MSN Messenger Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 21 Nov 2007, 04:31
I think you need this:

Quote:
invoke DragQueryFile,[wparam],0xFFFFFFFF,szdfn,0


And, if szdfn is allocated on the stack (variables local to the procedure are), then you have to change "szdfn" to "addr szdfn", that will calculate the offset and pass that pointer to the API. http://flatassembler.net/docs.php?article=win32 explains how addr works at 2.1 Procedure parameters.
Post 21 Nov 2007, 04:31
View user's profile Send private message Reply with quote
tangent



Joined: 21 Nov 2007
Posts: 9
tangent 21 Nov 2007, 05:10
still getting the same error..
by the way it looks like so now:
local szdfn db 128
invoke DragQueryFile,[wparam],0,addr szdfn,128

_________________
arg
Post 21 Nov 2007, 05:10
View user's profile Send private message AIM Address MSN Messenger Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 21 Nov 2007, 13:48
Try using "local str[128]:BYTE"
Post 21 Nov 2007, 13:48
View user's profile Send private message Reply with quote
tangent



Joined: 21 Nov 2007
Posts: 9
tangent 21 Nov 2007, 15:35
well, i noticed that even if i remove szdfn from it, same error..
invoke DragQueryFile,[wparam],-1,0,0
macro/proc32.inc [20] invoke [6]:
call [proc] }
error: undefined symbol.
Post 21 Nov 2007, 15:35
View user's profile Send private message AIM Address MSN Messenger Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 21 Nov 2007, 16:10
No, now it is a new error. You have not imported DragQueryFile anywhere.

Can you post the code? I think we never get it work by just reading a single line of code.
Post 21 Nov 2007, 16:10
View user's profile Send private message Reply with quote
coconut



Joined: 02 Apr 2004
Posts: 326
Location: US
coconut 21 Nov 2007, 20:21
you can also look in fasmw source for example of this
Post 21 Nov 2007, 20:21
View user's profile Send private message Reply with quote
tangent



Joined: 21 Nov 2007
Posts: 9
tangent 21 Nov 2007, 23:28
i dont have a copy of the fasmw source.. the prog source is here: http://pastebin.ca/793126
Post 21 Nov 2007, 23:28
View user's profile Send private message AIM Address MSN Messenger Reply with quote
wisepenguin



Joined: 30 Mar 2005
Posts: 129
wisepenguin 21 Nov 2007, 23:35
hi tangent,

Code:
  library kernel32,'KERNEL32.DLL',\
          user32,'USER32.DLL',\
          shell32, "shell32.dll"

  include 'api\kernel32.inc'
  include 'api\user32.inc'
  include "api\shell32.inc" 
    


works for me using fasm 1.67.23 (latest as of now)
Post 21 Nov 2007, 23:35
View user's profile Send private message Reply with quote
tangent



Joined: 21 Nov 2007
Posts: 9
tangent 21 Nov 2007, 23:44
well, damn. i appreciate it
Post 21 Nov 2007, 23:44
View user's profile Send private message AIM Address MSN Messenger Reply with quote
coconut



Joined: 02 Apr 2004
Posts: 326
Location: US
coconut 26 Nov 2007, 16:16
the source is included with the fasm packages
Post 26 Nov 2007, 16:16
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.