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

x
?
Solved

How can I run enother exe app

Posted on 1998-06-14
7
Medium Priority
?
236 Views
Last Modified: 2010-04-04
I nead to run another application from my exe
program.
I tryed to use ExecuteFile and ShellExecute,
however delphi(3) replays with "Undeclared identifier"

0
Comment
Question by:mAmitai
[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 2

Expert Comment

by:rene100
ID: 1352648
can you please give us the code you use?

rene100
0
 
LVL 1

Author Comment

by:mAmitai
ID: 1352649
ExecuteFile('DINAMIC.EXE', '', 'C:\EPC\', SW_SHOW);
the syntax is streit from delphi's lousy help.
Any way, eny other method will do.
0
 
LVL 3

Accepted Solution

by:
Matvey earned 200 total points
ID: 1352650
To use that procedure you have to include the unit that contains it. Look in the lousy help for the unit name...

But for executing exe's you better use a much more functional components. I'll send you one if you post email.

Regards,
Matvey
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.

 
LVL 5

Expert Comment

by:inter
ID: 1352651
Hi friends,

Matvey, you are faster than me. Use the following (PLEASE GIVE POINTS TO MATVEY I think he has the similiar code)...

I do not know the API ExecuteFile. However win32 helps said that to run a program from Win32 we'd better use CreateProcess. It has several parameters and looks complicated. May be you can make use of the following code:


 { returns -1 if the Exec failed }
 function WinExec32(FileName:String; Visibility : integer):integer;
 var
   zAppName:array[0..512] of char;
   zCurDir:array[0..255] of char;
   WorkDir:String;
   StartupInfo:TStartupInfo;
   ProcessInfo:TProcessInformation;
 begin
   StrPCopy(zAppName,FileName);
   GetDir(0,WorkDir);
   StrPCopy(zCurDir,WorkDir);
   FillChar(StartupInfo,Sizeof(StartupInfo),#0);
   StartupInfo.cb := Sizeof(StartupInfo);
   StartupInfo.dwFlags := STARTF_USESHOWWINDOW;
   StartupInfo.wShowWindow := Visibility;
   if not CreateProcess(nil,
     zAppName,                      { pointer to command line string }
     nil,                           { pointer to process security attributes }
     nil,                           { pointer to thread security attributes }
     false,                         { handle inheritance flag }
     CREATE_NEW_CONSOLE or          { creation flags }
     NORMAL_PRIORITY_CLASS,
     nil,                           { pointer to new environment block }
     nil,                           { pointer to current directory name }
     StartupInfo,                   { pointer to STARTUPINFO }
     ProcessInfo) then              { pointer to PROCESS_INF }
      Result := -1
 end;

Just call it as WinExec32('DINAMIC.EXE', SW_SHOW');
if you still got the error it absolutely means that SW_SHOW is not declared. So include Windows.pas in your USES clause.
Regards, Igor
0
 
LVL 1

Author Comment

by:mAmitai
ID: 1352652
I used "inter" answer, so he shuld get the points.
In VB and the good old C, it is so simple...
Borland shuld realy improve there help.

   THanks Guys...


0
 
LVL 3

Expert Comment

by:Matvey
ID: 1352653
So you don't want the component? Weired! It's very useful and has lot's of functions.

Propably Igors code...

PS Igor, you're awake on the weekend - how about talking friend?
0
 
LVL 1

Author Comment

by:mAmitai
ID: 1352654
I wold love to have the component!
EMAIL:amitai@plasson.co.il
I Used wat's close to the eye and working...

   Amitai

0

Featured Post

Independent Software Vendors: 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…
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 you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

636 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