🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #11408

Re: CreateProcess

#11408
From: Bob Gonder
Date: Mon, 09 Feb 2004 01:40
25 lines
2373 bytes
Fraser Ross wrote:

>int res=CreateProcess(NULL, (LPTSTR)command_line.c_str(), 0, 0, false,
>CREATE_NEW_CONSOLE, 0, 0, &si, &pi);
>
>command_line has something like "prog.exe \"C:\temp\file.ext\"".
>si and pi are zeroed.
>The called program is a dos program.  I don't know why it works with long
>file names.  As I said prog.exe in this example would have to be in C:\temp
>as well as the directory of the calling program. The message 'cannot find
>the file prog.exe. make sure that the file exists on your system and that
>the path and filename are correct.'  appears if prog.exe is not in C:\temp.
>I'm not sure where it comes from.

You still haven't said what it is you _expect_ it to do that it isn't
doing.

Your code above (except for the slashes problem \\ ) is correct for 16
bit apps.  The OS is supposed to look in the current directory of the
calling app, then in the standard Windows directories
(Windows\System32), then the directories in your PATH environment
variable.  Only difference is in NT (which  Win2000 is) also searches
Windows/System for 16bit apps.

It's all documented in the Help.
Technical Details
Message-ID: <glod205ckk09fb7gb6sda88p2hpd0fj9t8@4ax.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-05!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!217.73.144.44.MISMATCH!ecngs!feeder.ecngs.de!news.cambrium.nl!news.cambrium.nl!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <40267a98@newsgroups.borland.com> <254d20lh2raerd347s2t8qpa8u1dcom3e0@4ax.com> <40269570@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,b85ad1154737de24
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2004-02-08 18:09:39 PST
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: CreateProcess
Date: Sun, 08 Feb 2004 17:40:18 -0800
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <glod205ckk09fb7gb6sda88p2hpd0fj9t8@4ax.com>
References: <40267a98@newsgroups.borland.com> <254d20lh2raerd347s2t8qpa8u1dcom3e0@4ax.com> <40269570@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 67.31.165.87
X-Trace: newsgroups.borland.com 1076290819 67.31.165.87 (8 Feb 2004 17:40:19 -0800)
Lines: 28
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-05!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!217.73.144.44.MISMATCH!ecngs!feeder.ecngs.de!news.cambrium.nl!news.cambrium.nl!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail