delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/04/24/12:23:21

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
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" <elfyn-cygwin AT exposure DOT org DOT uk>
To: "cygwin" <cygwin AT cygwin DOT com>, "Tron Thomas" <tron DOT thomas AT verizon DOT net>
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
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

<http://www.cygwin.com/ml/cygwin/2003-04/msg00451.html>

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019