I am trying to link a masm obj to delphi 6.
This is my first time.
I have this piece of code,
is it good ?

.model flat, stdcall
option casemap:none

include user32.inc
includelib user32.lib

Msg db "Msg" ,0
Title db "Title" ,0


MsgBox proc
invoke MessageBox, 0, offset Msg, offset Title, 0
MsgBox endp


or do I have to write the code like writting a complete masm program using Start:
end Start, ExitProcess and those kind of stuff ?

because I get errors.
I have converted the coff obj to omf, but still delphi compiler gives me errors.

Posted on 2003-08-27 14:48:54 by Jnrz
How to include a masm object file in a Delphi project:

1. Use pascal calling convention: .model flat, PASCAL
2. Do not use any other section than .code (no .data at all!)
3. You can only have one procedure i an object file. Use local procs or several files if you need more than one.
4. Assemble using the /Fo switch. Change in your radasm project file (*.rap) to 2=3,O,$B\ML.EXE /I"$I" /c /Fo ,3,2

Here is an example:
Posted on 2003-12-21 10:34:24 by Delight
Thanks Delight,

I will take a look at it :)
Posted on 2003-12-21 10:42:09 by Jnrz
And, as far as I remember, the .obj cannot have any external .lib dependencies.
Posted on 2003-12-22 15:34:27 by Morris