Solved

LINK .exe or .obj & run it

Posted on 2000-04-26
6
348 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi OLE Error 8 93
How to use Hashing sha1 in Delphi 2010 4 199
Sending Gmail through Delphi 3 91
Working with hours 3 46
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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

914 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now