Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

LINK .exe or .obj & run it

Posted on 2000-04-26
6
Medium Priority
?
360 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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 450 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

772 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