flat assembler
Message board for the users of flat assembler.

Index > Windows > error : operand size not specified

Author
Thread Post new topic Reply to topic
codex32



Joined: 02 Oct 2004
Posts: 5
codex32
I get this error on this line :

Code:
invoke drawframe,[hWnd],9,9,101,201    


How can i solve the error ?
Post 02 Oct 2004, 18:56
View user's profile Send private message Reply with quote
mike.dld



Joined: 03 Oct 2003
Posts: 235
Location: Belarus, Minsk
mike.dld
Use this:
Code:
proc drawframe,wnd,a,b,c,d
...
endp
...
stdcall drawframe,[hwnd],1,2,3,4    

or this:
Code:
drawframe dd _drawframe
...
proc _drawframe,wnd,a,b,c,d
...
endp
...
invoke drawframe,[hwnd],1,2,3,4    
Post 02 Oct 2004, 20:54
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
codex32



Joined: 02 Oct 2004
Posts: 5
codex32
Thanks Mike. It works now.

With procedure definition, are the parameters by default dword size ?
Post 02 Oct 2004, 21:36
View user's profile Send private message Reply with quote
mike.dld



Joined: 03 Oct 2003
Posts: 235
Location: Belarus, Minsk
mike.dld
stdcall.inc:
Code:
macro proc name,[arg]
 { common
    if used name
    name:
    all@args fix arg
    virtual at ebp+8
    if ~ arg eq
   reverse
    first@args fix arg
   forward
     local ..arg
     ..arg dd ? ; <-- here arguments are decleared as dword
     arg equ ..arg
   common
     end if
     ..ret = $ - (ebp+8)
    end virtual
    local ..data,..size
    if defined ..size
     virtual at ebp - ..size
    else
     if ..ret
      push ebp
      mov ebp,esp
     end if
    end if
     ..data:
    macro enter size,level
     _% if size eq & level eq
       rb (4 - ($-..data) and 11b) and 11b
         if defined ..size
    ..size = $ - ..data
         end virtual
        else
         ..size = $ - ..data
        end if
      if ..ret | defined ..size
    push ebp
    mov ebp,esp
         if ..size
    sub esp,..size
     end if
     end if
     else
         enter size,level
   end if %_
    macro return
     _% if ..ret | defined ..size
    leave
     end if
      if ..ret
     retn ..ret
 else
         retn
       end if %_ }    
Code:
macro stdcall proc,[arg]
 { reverse
    pushd arg ; <-- see there? 'pushd arg' means 'push dword arg'
   common
    call proc }    
Code:
macro invoke proc,[arg]
 { common
    if ~ arg eq
   reverse
     pushd arg ; <-- and there
   common
     call [proc]
    else
     call [proc]
    end if }    
Post 03 Oct 2004, 07:50
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
codex32



Joined: 02 Oct 2004
Posts: 5
codex32
Thanks (better late than never) Smile
Post 15 Jun 2005, 13:11
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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.