Solved

LINK .exe or .obj & run it

Posted on 2000-04-26
6
347 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
Comment Utility
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
Comment Utility
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
Comment Utility
look for a question 'binding a file' he asked a similar question to you question
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 15

Expert Comment

by:simonet
Comment Utility
>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
Comment Utility
You can search $L in Delphi Help for more details
0
 
LVL 10

Accepted Solution

by:
Lischke earned 150 total points
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 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

18 Experts available now in Live!

Get 1:1 Help Now