Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <005401c30a7d$d1b585b0$065b86d9@ellixia> From: "Elfyn McBratney" To: "cygwin" , "Tron Thomas" References: <3EA80ED1 DOT 4030303 AT verizon DOT net> Subject: Re: How to parse windows command line Date: Thu, 24 Apr 2003 17:23:15 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 > Here is the code that is relevant to the problem: > > int WINAPI WinMain > ( > HINSTANCE, > HINSTANCE, > LPSTR pszArguments, > int > ) > { > std::string strTitle(pszArguments); > ... > > > If I compile this with the Borland compiler and then lauch the program > from bash using: ./Program.exe Filename, then pszArguments (and > consequently strTitle) just equals "Filename". > > If I compile with Cygwin and launch the file the same way, pszArguments > equals something like: "Directory\\Directory\\Program.exe\" Filename " > > pszArgument doesn't even contain the full path to the executable. It > starts partway through the path name, containing only the ending portion > of one of the directories in the path name. > I don't really care about the executable path name. All I want is the > filename, like what I get when I compile with Borland or Microsoft. This might help you out. Elfyn -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/