Solved

Emdedding an app within Delphi application

Posted on 1998-07-09
7
152 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 150 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
Industry Leaders: 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

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…
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…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

707 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