News:

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

MsgBox Macro

Started by Robert Collins, January 03, 2005, 06:59:32 AM

Previous topic - Next topic

Robert Collins

In the masm32\html\CODEDESN.HTM I find the following:

MsgBox hWnd,"Hi, I am written in MASM32","Greetings",MB_OK

But when I go to use it in a very simple program I get the following Assembler complaints:

warning A4006: too many arguments in macro call
error A2084: constant value too large
error A2084: constant value too large

What's wrong here?       

hutch--

Dunno what you have done.

; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

    .486                       ; create 32 bit code
    .model flat, stdcall       ; 32 bit memory model
    option casemap :none       ; case sensitive

    include \masm32\include\windows.inc
    include \masm32\include\masm32.inc
    include \masm32\include\gdi32.inc
    include \masm32\include\user32.inc
    include \masm32\include\kernel32.inc
    include \masm32\include\Comctl32.inc
    include \masm32\include\comdlg32.inc
    include \masm32\include\shell32.inc
    include \masm32\include\oleaut32.inc
    include \masm32\macros\macros.asm

    includelib \masm32\lib\masm32.lib
    includelib \masm32\lib\gdi32.lib
    includelib \masm32\lib\user32.lib
    includelib \masm32\lib\kernel32.lib
    includelib \masm32\lib\Comctl32.lib
    includelib \masm32\lib\comdlg32.lib
    includelib \masm32\lib\shell32.lib
    includelib \masm32\lib\oleaut32.lib

    .code

; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

start:

    MsgBox 0,"Hi","Title",MB_OK

    exit

; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

end start
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Vortex

Hi Robert,

Are you sure that you put all the necessary include files to your source code?

Robert Collins

Well, as it turns out, I was using a sample project from someone else and in the .asm file he had a .data section a mile long. Deep within that area he had his own version of the MsgBox macro along with his own version of other macros that also are in the MACROS.ASM file. I tried fixing it but it just got deeper into other assembly errors and I am not in the mood to straighten out all this error stuff since it is not my code to begin with and I don't know what anything has an effect on anything else so I just decided to trash it. It's not worth my time.

Thanks anyway.