Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Emdedding an app within Delphi application

Posted on 1998-07-09
7
Medium Priority
?
154 Views
Last Modified: 2010-04-04
I will like to include an .exe application to be run within my D3 application.  Please help!
0
Comment
Question by:Ogunbo
[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
7 Comments
 
LVL 8

Expert Comment

by:ZifNab
ID: 1357472
Hi Ogunbo,

 What do you exaclty want :

 Starting .exe from delphi program and receiving the error-codes? or ?...
 Zif.
0
 
LVL 5

Expert Comment

by:mayhew
ID: 1357473
If you want to run another .exe from your Delphi app you might be wanting to use the Win API call CreateProcess (for 32 bit apps - the 16 bit version was WinExec).

The description is in the Win32s.hlp file.

Be sure to include windows in your uses clause.  And you can see the Pascal function declaration in \source\rtl\win\windows.pas.  (My apologies if you already know this).
0
 

Accepted Solution

by:
kashif063098 earned 300 total points
ID: 1357474
Two  ways

1--using Winexec()
Example
fucntion AnyFunction:integer;
VAR
 appName:string;
 RESULT:integer
begin
 appName:=ApplcationPath; {C:\PKZIP.EXE}
 RESULT:=WinExec(appName,SW_SHOWNORMAL);
 IF RESULT > 31 THEN {if RESULT < 31 then there is some problem uses GetLastError                                     to find the reason}
 ShowMessage('Its ok,it should run the application' );

end;

2--Using CreateProcess() Win32 Api

function AnyFunction:integer;
begin
 CreateProcess(
                       {1}  PChar('C:\pkzip.exe'),  
                       {2}  PChar('c:\Pkzip.exe '+  'c:\z\z1.zip ' + FileToZip),
                       {3}  NIL,
                       {4}  NIL,
                       {5}  False,
                       {6}  0{CREATE_NEW_CONSOLE},
                       {7}  NIL,
                       {8}  PChar('C:\'),
                       {9}  lpStartupInfo,
                       {10} lpProcInformation) ;

end;

If you feel any difficulty in order to follow these examples ,let me know


bye


kashif
0
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.

 

Expert Comment

by:kashif063098
ID: 1357475
In second example use your application names and path.if CreateProcess() returns -1 uses GetLastError function to find out the reason of the failure
0
 
LVL 3

Expert Comment

by:vladika
ID: 1357476
Also you can use ShellExecute, ShellExecuteEx

0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1357477
Still, we don't know exactly what Ogunbo wants.
0
 

Author Comment

by:Ogunbo
ID: 1357478
Thank you all folks.  I will appreciate a real example of what the source should look like.  I have a database application made in D3 and I used another program to create an exe file.  Actually, this exe.file is an expert system that uses the same table as my database.  Since I couldn't program an expert system in Delphi, I am wondering if I can use the already made expert system (.exe file) in my database application.  Such that a user of the database might click a button called "expsys" for the expert system to be run.  In a way it would look like I am using D3 as an interface for the expert system.  Well, this is my problem and will appreciate what my unit should look like.  Thank you.
0

Featured Post

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!

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 Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

618 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