Solved

LINK .exe or .obj & run it

Posted on 2000-04-26
6
358 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month2 days, 18 hours left to enroll

621 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