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 :
for an error.
This is the objects .asm file:
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:
Thanks,
Rags
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
end
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:
MyMacro MACRO
mov eax, 1
mov ecx, 2
add eax, ecx
ENDM
Object MyOjbject, MyObjectID, Primer
StaticMethod DoSomething, dword
ObjectEnd
if IMPLEMENT
Method MyObject.DoSomething, uses ebx, LpBuffer:dword
mov ebx, LpBuffer
MyMacro
MethodEnd
endif
Thanks,
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 :)
Regards
Biterider
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 :)
Regards
Biterider
Thanks BiteRider, got it sorted out. I appreciate the help.
Thank You,
Rags
Thank You,
Rags