Link to home
Start Free TrialLog in
Avatar of Riquelme
Riquelme

asked on

how to link a masm obj to delphi 6

how do I link a masm obj to delphi 6 ?
I have converted the coff object to omf but still I get error.
here is my delphi code:

program demo;

{$L demo.obj}
{$R *.res}

procedure MsgBox; stdcall; external;

begin
  MsgBox();  
end.

and my masm code:

.386
.model flat, stdcall
option casemap:none

include user32.inc
includelib user32.lib

.data
      Msg      db "Mensaje" ,0
      Title      db "Titulo"  ,0
      
.code

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

end

thanks
ASKER CERTIFIED SOLUTION
Avatar of PatrickMMartin
PatrickMMartin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Riquelme
Riquelme

ASKER

Hi.
yes, inline assembler is better for small assembler rutines, but masm is better.
yes, tasm should solve the problem, but I have not use it.

the errors are:

[Error] demo.dpr(8): Bad object file format: 'D:\Programacion\DelphiYMasm\demo.obj'
[Error] demo.dpr(6): Unsatisfied forward or external declaration: 'MsgBox'
[Error] demo.dpr(12): Unsatisfied forward or external declaration: '_MessageBoxA@16'

my example is small because it is just a test.