* run external .exe files within an ada program..
@ 2001-07-04 14:09 Henrik Möllberg
2001-07-04 14:46 ` Alfred Hilscher
2001-07-04 15:59 ` David C. Hoos, Sr.
0 siblings, 2 replies; 6+ messages in thread
From: Henrik Möllberg @ 2001-07-04 14:09 UTC (permalink / raw)
how do I do that? does it exist any counterparts to "system" in perl or something?
(I'm developing in win32 environment)
regards,
Henrik
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: run external .exe files within an ada program..
2001-07-04 14:09 run external .exe files within an ada program Henrik Möllberg
@ 2001-07-04 14:46 ` Alfred Hilscher
2001-07-04 15:59 ` David C. Hoos, Sr.
1 sibling, 0 replies; 6+ messages in thread
From: Alfred Hilscher @ 2001-07-04 14:46 UTC (permalink / raw)
Look here for an example:
http://www.adapower.com/os/win32-createprocess.html
Henrik M�llberg wrote:
>
> how do I do that? does it exist any counterparts to "system" in perl or something?
>
> (I'm developing in win32 environment)
>
> regards,
> Henrik
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: run external .exe files within an ada program..
2001-07-04 14:09 run external .exe files within an ada program Henrik Möllberg
2001-07-04 14:46 ` Alfred Hilscher
@ 2001-07-04 15:59 ` David C. Hoos, Sr.
2001-07-05 12:50 ` wzm
2001-07-05 13:30 ` Ted Dennison
1 sibling, 2 replies; 6+ messages in thread
From: David C. Hoos, Sr. @ 2001-07-04 15:59 UTC (permalink / raw)
To: comp.lang.ada; +Cc: mollberg
[-- Attachment #1: Type: text/plain, Size: 690 bytes --]
The attachment is an Ada95 binding to the C function "system."
The binding is portable across operating systems -- i.e., it's not
limited to Win32 platforms.
----- Original Message -----
From: "Henrik M�llberg" <mollberg@hotmail.com>
Newsgroups: comp.lang.ada
To: <comp.lang.ada@ada.eu.org>
Sent: July 04, 2001 9:09 AM
Subject: run external .exe files within an ada program..
> how do I do that? does it exist any counterparts to "system" in perl or
something?
>
> (I'm developing in win32 environment)
>
> regards,
> Henrik
> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada.eu.org
> http://ada.eu.org/mailman/listinfo/comp.lang.ada
>
[-- Attachment #2: execute_shell_command.adb --]
[-- Type: application/octet-stream, Size: 404 bytes --]
------------------------------------------------------------------------
with Interfaces.C;
function Execute_Shell_Command (The_Command_String : String)
return Interfaces.C.Int is
package C renames Interfaces.C;
function System (S : C.Char_Array) return C.Int;
pragma Import (C, System, "system");
begin
return System (C.To_C (The_Command_String));
end Execute_Shell_Command;
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: run external .exe files within an ada program..
2001-07-04 15:59 ` David C. Hoos, Sr.
@ 2001-07-05 12:50 ` wzm
2001-07-05 13:30 ` Ted Dennison
1 sibling, 0 replies; 6+ messages in thread
From: wzm @ 2001-07-05 12:50 UTC (permalink / raw)
in GNAT,there are two subprograms in GNAT.OS_LIB,
procedure Spawn
(Program_Name : String;
Args : Argument_List;
Success : out Boolean);
function Non_Blocking_Spawn
(Program_Name : String;
Args : Argument_List)
return Process_Id;
they can execute the external file.
"David C. Hoos, Sr." <david.c.hoos.sr@ada95.com> wrote in message news:<mailman.994262345.19004.comp.lang.ada@ada.eu.org>...
> The attachment is an Ada95 binding to the C function "system."
>
> The binding is portable across operating systems -- i.e., it's not
> limited to Win32 platforms.
>
> ----- Original Message -----
> From: "Henrik M�llberg" <mollberg@hotmail.com>
> Newsgroups: comp.lang.ada
> To: <comp.lang.ada@ada.eu.org>
> Sent: July 04, 2001 9:09 AM
> Subject: run external .exe files within an ada program..
>
>
> > how do I do that? does it exist any counterparts to "system" in perl or
> something?
> >
> > (I'm developing in win32 environment)
> >
> > regards,
> > Henrik
> > _______________________________________________
> > comp.lang.ada mailing list
> > comp.lang.ada@ada.eu.org
> > http://ada.eu.org/mailman/listinfo/comp.lang.ada
> >
>
> --
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: run external .exe files within an ada program..
2001-07-04 15:59 ` David C. Hoos, Sr.
2001-07-05 12:50 ` wzm
@ 2001-07-05 13:30 ` Ted Dennison
1 sibling, 0 replies; 6+ messages in thread
From: Ted Dennison @ 2001-07-05 13:30 UTC (permalink / raw)
In article <mailman.994262345.19004.comp.lang.ada@ada.eu.org>, David C. Hoos,
Sr. says...
>
>This is a multi-part message in MIME format.
David, is there any way you can get rid of the MIMEs? I hate mimes....
---
T.E.D. homepage - http://www.telepath.com/dennison/Ted/TED.html
home email - mailto:dennison@telepath.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: run external .exe files within an ada program..
@ 2001-07-10 22:16 Beard, Frank
0 siblings, 0 replies; 6+ messages in thread
From: Beard, Frank @ 2001-07-10 22:16 UTC (permalink / raw)
To: 'comp.lang.ada@ada.eu.org'
Henrik,
Someone might have answered this already, but one of
the simplest ways is to use Winexec. As in:
status :=
Win32.Winbase.WinExec(lpCmdLine => To_Lpcstr("C:\MyDir\My.exe"),
uCmdShow => Win32.Winuser.SW_HIDE);
This is superceded by the more complicated CreateProcess API, but
it will probably never go away, at least not for a long time.
John English also sent an example of another API which works as well.
Win32.WinDef.HINSTANCE hInst :=
Win32.ShellAPI.ShellExecute(
System.Null_Address, -- no parent window
To_LPCSTR("open" & ASCII.NUL), -- command
To_LPCSTR("c:\MyDir\My.exe" & ASCII.NUL), -- file to open
System.Null_Address, -- no parameters
System.Null_Address, -- no default directory
Win32.WinUser.SW_SHOWNORMAL -- show window normally
);
Hope this helps.
Frank
-----Original Message-----
From: mollberg@hotmail.com [mailto:mollberg@hotmail.com]
Sent: Wednesday, July 04, 2001 10:09 AM
To: comp.lang.ada@ada.eu.org
Subject: run external .exe files within an ada program..
how do I do that? does it exist any counterparts to "system" in perl or
something?
(I'm developing in win32 environment)
regards,
Henrik
_______________________________________________
comp.lang.ada mailing list
comp.lang.ada@ada.eu.org
http://ada.eu.org/mailman/listinfo/comp.lang.ada
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2001-07-10 22:16 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-04 14:09 run external .exe files within an ada program Henrik Möllberg
2001-07-04 14:46 ` Alfred Hilscher
2001-07-04 15:59 ` David C. Hoos, Sr.
2001-07-05 12:50 ` wzm
2001-07-05 13:30 ` Ted Dennison
-- strict thread matches above, loose matches on Subject: below --
2001-07-10 22:16 Beard, Frank
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox