🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: CreateProcess fails under Win XP

#12785
From: Sergey Muschin
Date: Mon, 17 Nov 2003 19:58
43 lines
2478 bytes
 If you are using a long file name that contains a space, use quoted strings
to indicate where the file name ends and the arguments begin; otherwise, the
file name is ambiguous. For example, consider the string "c:\program
files\sub dir\program name". This string can be interpreted in a number of
ways. The system tries to interpret the possibilities in the following
order:
c:\program.exe files\sub dir\program name
c:\program files\sub.exe dir\program name
c:\program files\sub dir\program.exe name
c:\program files\sub dir\program name.exe


> char Prog[40] = "C:\\Program Files\\Yamp 2.3\\yamp20.exe ";
>
> *************
>
> STARTUPINFO si;
> PROCESS_INFORMATION pi;
>
>
> //---------------------------------------------------------------
>
> void __fastcall TForm1::Yamp1Click(TObject *Sender)
> {
>     ZeroMemory( &si, sizeof(si) );       //clear info files
>     si.cb = sizeof(si);
>     ZeroMemory( &pi, sizeof(pi) );
>
>     if( !CreateProcess( NULL,       //Start the process.
>              Prog,                  // Command line.
>              NULL,
>              NULL,
>              FALSE,
>              0,
>              NULL,
>              NULL,
>              &si,            //Pointer to STARTUPINFO
>              &pi ))          //Pointer to PROCESS_INFORMATION
>         {
>          IO_Error = 'G';     //Set Code, program didn't start
>         }
>     else
>
Technical Details
Message-ID: <3fb92855$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!opentransit.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3fb9254a$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,9dd22bf10a5b73fb
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-11-17 12:09:54 PST
Reply-To: "Sergey Muschin" <SMuschin@tonservices.com>
From: "Sergey Muschin" <SMuschin@tonservices.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3fb9254a$1@newsgroups.borland.com>
Subject: Re: CreateProcess fails under Win XP
Date: Mon, 17 Nov 2003 12:58:12 -0700
Lines: 45
Organization: FlyingJ
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 204.110.225.254
Message-ID: <3fb92855$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1069099093 204.110.225.254 (17 Nov 2003 11:58:13 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!opentransit.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail