Solved

Dos-app.safe?

Posted on 1997-05-22
4
196 Views
Last Modified: 2010-04-04
How do I run an Dos-application safely (without any problems with memory, collision etc.)from my self-developed Delphi-application? I have tried to do it with the Winexec-command (WinExec('c:\test\test.exe' ,SW_maximize);), however it does not work properly all the times, only sometimes (Depending on ...?). Please give me a syntax example...
Thanks!!  Erik N
PS. I run Delphi Developer R2....
PS2. I do not understand the syntax of Createprocess,(I need a syntax example)...
0
Comment
Question by:Erik N
  • 2
4 Comments
 
LVL 4

Expert Comment

by:erajoj
ID: 1336542
Delphi version?
Have you looked at createprocess?
0
 

Author Comment

by:Erik N
ID: 1336543
Edited text of question
0
 

Author Comment

by:Erik N
ID: 1336544
Edited text of question
0
 
LVL 1

Accepted Solution

by:
sleach earned 100 total points
ID: 1336545
Here is an example of CreateProcess.  I have tested it, and it works fine Running Dos applications.

Hope this helps.

procedure TForm1.Button1Click(Sender: TObject);
VAR
TPI : TProcessInformation;
TSI : TStartupInfo;
begin
if OpenDialog1.execute then
  begin
  FillChar(TSI, SizeOf(TSI), 0);
  TSI.CB := SizeOf(TSI);
  CreateProcess(PChar(OpenDialog1.FileName), NIL, NIL, NIL, False,
    DETACHED_PROCESS OR NORMAL_PRIORITY_CLASS, NIL, NIL,
    TSI, TPI);
  end;

end;

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Filemaker 14 vs Delphi Embarcadero 7 187
Delphi component that can load a DLL in design time? 8 53
Print Graphic and Text to Epson TM-T88v 12 188
Performance of SQL statement 37 101
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

863 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

23 Experts available now in Live!

Get 1:1 Help Now