Hello,

I am a delphi coder so i have a question.
Can I make with Delphi Obj and can i shell it with MASM32.

If I make procedure and functions with Delphi OBJ.
Can I include this obj in masm32 and shellexecute this procedure in
the Delphi OBJ. I have written in Delphi???
Posted on 2003-06-02 08:06:58 by Fred
I guess you wanted to ask if you can link the .obj file generated with delphi,
answer to this is NO. (I tried)

You can make a DLL and use the exported functions in both
ways... for this you might want to check out:

LoadLibrary
GetProcAddress
FreeLibrary



have fun
Posted on 2003-06-02 09:33:52 by Azrim
Hello,

Thanks for your thread.

If i have a ready Code and compile for EXE Files.
And I want to make a DLL.

That are the option (parameter) for the link32?

There are change the code too for DLL???
Posted on 2003-06-02 09:50:48 by Fred
Please download and install the masm package,

you will find an example in C:\masm32\EXAMPLE1\DLL

here is the delphi code needed to test this DLL (TSTDLL.DLL)
(I tested it on Delphi 7)



program testmasmdll;

{$APPTYPE CONSOLE}

uses
SysUtils,Windows;

const
DLL_FULL_PATH = 'C:\masm32\EXAMPLE1\DLL\TSTDLL.DLL';
DLL_EXPORTED_FUNCTION = 'TestProc';
Var
DLL_HANDLE : Cardinal;
PROC_HANDLE : Procedure;
begin
Writeln('Loading ',DLL_EXPORTED_FUNCTION,' from ',DLL_FULL_PATH);
DLL_HANDLE := LoadLibrary(DLL_FULL_PATH); {Load DLL if not loaded, get addr}
PROC_HANDLE := GetProcAddress(DLL_HANDLE,DLL_EXPORTED_FUNCTION); {Load pointer to procedure}
Writeln('Executing..');
PROC_HANDLE; {Invoke/Call it here}
Writeln('Done!');
FreeLibrary(DLL_HANDLE); {oops, I forgot to free it :)}
end.



You will see it is quite easy.
Posted on 2003-06-02 09:54:27 by Azrim
One question for you:

Which one of these are you after..

1) Write a DLL in MASM and use it from Delphi
2) Write a DLL in Delphi and use it from MASM

?
Posted on 2003-06-02 10:03:44 by Azrim