Solved

Dos-app.safe?

Posted on 1997-05-22
4
202 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
[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
  • 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

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!

Question has a verified solution.

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

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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 …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses
Course of the Month11 days, 12 hours left to enroll

623 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