This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: How to parse windows command line
- 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>
- Date: Thu, 24 Apr 2003 17:23:15 +0100
- Subject: Re: How to parse windows command line
- References: <3EA80ED1.4030303@verizon.net>
> 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/