?
Solved

Emdedding an app within Delphi application

Posted on 1998-07-09
7
Medium Priority
?
153 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
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!

 

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

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…
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…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

752 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