I have a problem  adding my own macros from an .inc file to an object. At compile time the macros are not being recognized.
I am getting :
D:\Masm32\ObjAsm32\Code\Objects\MyObject.inc(303) : error A2008: syntax error : MyMacro

for an error.
This is the objects .asm file:

include Objects.cop
include D:\masm32\ObjAsm32\Code\Macros\MyMacros.inc   

include Primer.inc

MakeObjects MyObject


But if I remove the line from the .asm file above, that includes MyMacros and put the macro def's on top of the objects implementation inc file, everything works fine.
example-this works:

    mov eax, 1
    mov ecx, 2
    add eax, ecx

Object MyOjbject, MyObjectID, Primer
  StaticMethod    DoSomething,    dword

Method    MyObject.DoSomething, uses ebx, LpBuffer:dword
            mov ebx, LpBuffer

Posted on 2006-03-26 08:09:09 by rags
Hi Rags
I guess to know what is happening. First of all, I have to clarify some things:
- the MyObject.asm file serves only the purpose to build a lib file of  precompiled code. It isn’t used anywhere else.
- in your project file you can include objects using MakeObjects or LoadObjects. The first one loads the whole source code, while the other loads the compiled code from the library you build before. Object ancestors must be loaded first.

OK, if you use “MakeObjects MyObject???, it includes the MyObject.inc file where you have no reference to MyMacros. I suggest adding it in the project file as you have done in the MyObject.asm file

If you use LoadObjects, the macro was resolved at the moment you build the library, so you don’t need to include the MyMacros file. You can leave it there, it is simply redundant.

I hope I hit your problem, but it not, please write again  :)


Posted on 2006-03-26 12:26:00 by Biterider
Thanks BiteRider, got it sorted out. I appreciate the help.
Thank You,
Posted on 2006-03-26 14:57:04 by rags