Solved

LINK .exe or .obj & run it

Posted on 2000-04-26
6
353 Views
Last Modified: 2011-10-03
Hello,
is there anyway in Delphi 5  to link .exe or .obj  Files direclty into a Delphi Program and then execute it at run-time and passing command line to the linked .exe/.obj ?
0
Comment
Question by:brain3000
6 Comments
 
LVL 3

Expert Comment

by:shenqw
ID: 2752273
Oh,No way at run_time,At design time you can use {$L 'YourObjFile.OBJ'} to link the obj file into your Delphi Program.
0
 

Author Comment

by:brain3000
ID: 2752307
shenqw, how can i start the linked .obj and pass the commandline to the linked.obj when i use {$L 'name.obj'} at design time ?

i have a delphi program (with source) and a asm program (with source) and i like to link this two programs into one executable.

the reason is, i like to write a GUI for the asm prog.
and i cant include the asm file in the delphi program because there are some unsupported asm funtions in the asm tool
0
 
LVL 3

Expert Comment

by:f15iaf
ID: 2752484
look for a question 'binding a file' he asked a similar question to you question
0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 15

Expert Comment

by:simonet
ID: 2752493
>unsupported asm

There's no such thing. If there's an mnemonic which Delphi doesn't decognize, just use its opcode (by using dw, dd, etc).

Alex
0
 
LVL 3

Expert Comment

by:shenqw
ID: 2752574
You can search $L in Delphi Help for more details
0
 
LVL 10

Accepted Solution

by:
Lischke earned 150 total points
ID: 2754561
brain3000,

actually your question is a bit confusing because you are talking about an object file and command line parameters etc. This makes no sense as an object file is something like an unusable collection of routines which must be linked with other code to do something useful.

What you need to make it work is:

1) compile your asm file(s) into obj file(s), unfortunately D4 and 5 don't include TASM anymore so you have to find another assembler which can produce the correct object files (note: you need the OMF format as produced by TASM or BCB, VC++ creates COFF object files)

2) link your object file(s) by using the already mentioned {$L xxx.obj} directive

3) either use a call to the API GetCommandLine in your assembler code to retireve the command line or use ParamCount and ParamStr from Delphi and pass the results to an assembler routine of your choice (in both cases you need a routine in your assembler code to be called from Delphi, so the second way is probably the better one).

Ciao, Mike
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question