This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to parse windows command line


> 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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]