News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

What is FUNC???

Started by localmotion34, May 31, 2007, 05:54:23 PM

Previous topic - Next topic

localmotion34

i have this code block from source DougieM wrote for a custom control.  I get a "sytax error" at a statement like this:

; select type of background if gif is transparant
  .if FUNC(GetObject,[ebx].backg,0,0) == sizeof LOGBRUSH   <<-------- DIES RIGHT HERE
      invoke FillRect,memdc,addr [ebx].rc,[ebx].backg; if a brush has been sent in backg
  .else                                              ; fill with brush
      invoke CreateCompatibleDC,hdc
      mov backdc,eax
      invoke SelectObject,backdc,[ebx].backg        ; or a bitmap
      push eax                                      ; then copy backg bmp into our memdc
      invoke BitBlt,memdc,0,0,[ebx].rc.right,[ebx].rc.bottom,backdc,0,0,SRCCOPY   
      pop eax
      invoke SelectObject,backdc,eax
      invoke DeleteDC,backdc
  .endif


Why is the compiler dying right here at this point?

ragdog

hi

is a invoke macro



  FUNC MACRO parameters:VARARG
        invoke parameters
        EXITM <eax>
      ENDM


greets
ragdog

Vortex

localmotion34,

Here is a quick example :

mov hModule,FUNC(GetModuleHandle,0)

is equivalent to :

invoke GetModuleHandle,0
mov hModule,eax

localmotion34

Thanks to you both!!!

i included the macro, and boom, the LIB compiled.  There are so many macros for MASM, i'm having trouble reading much of any code without having to constantly search for macro.inc files. 

ragdog

you must simply search in the board or with google for the appropriate macro!

and it more simply to coding if one macros uses :U

ragdog

Vortex

localmotion34,

Never hesitate to post here your questions. To study the basic principles of MASM macros, have a look at here :

Chapter Nine: Using Macros

http://webster.cs.ucr.edu/Page_TechDocs/MASMDoc/ProgrammersGuide/Chap_09.htm

hutch--

localmotion34,

Use the existing HELP FILE in masm32 for all of the high leel help. Thats what its there for. MASM is a macro assembler and this is used to simplify much of the code for people leqarning assembler programming.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php