Article View: borland.public.cppbuilder.nativeapi
Article #16111CreateProcess() passing cmd line args
From: CC
Date: Fri, 30 May 2003 20:14
Date: Fri, 30 May 2003 20:14
30 lines
1752 bytes
1752 bytes
Greetings; I'm using CreateProcess() to invoke another program. Ex: char *appname = "c:\mytest.exe"; char *args="/myarg1"; When I call : CreateProcess(appname, args, .......); When application "mytest.exe" calls ParamCount(), the value is Zero. It seems to be that I cannot pass arguments as the 2nd parameter to CreateProcess()? The application does work when I include the full command line such as: char *fullcmdline = "c:\mytest.exe /myarg1"; CreateProcess(NULL,fullcmdline,.....); This works, I'm really confused on how to call this api - should arguments passed in separately? or on full command line? What then is the purpose of having the first 2 parameters for CreateProcess() Why not have just a command line? Any insight would be much appreciated. Thanks CurtC
Technical Details
Message-ID:
<3ed7bb90@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!sn-xit-08!supernews.com!border3.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,bd638ff0f0e40f6,start X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-05-30 13:48:36 PST From: "CC" <Xcurtc@tmscorp.com> Newsgroups: borland.public.cppbuilder.nativeapi Subject: CreateProcess() passing cmd line args Date: Fri, 30 May 2003 15:14:48 -0500 Lines: 32 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 208.254.250.201 Message-ID: <3ed7bb90@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1054325648 208.254.250.201 (30 May 2003 13:14:08 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!sn-xit-08!supernews.com!border3.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail