delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/04/04/13:08:58

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
X-Injected-Via-Gmane: http://gmane.org/
To: cygwin AT cygwin DOT com
From: "BB" <canofspam AT att DOT net>
Subject: Re: Bug in GUI App WinMain Arguements
Date: Fri, 4 Apr 2003 12:08:46 -0600
Lines: 113
Message-ID: <b6khmq$3mk$1@main.gmane.org>
References: <b6kfnf$nb9$1 AT main DOT gmane DOT org> <OE19Dc41W2ufyWOxbCJ000162eb AT hotmail DOT com>
Reply-To: "BB" <canofspam AT att DOT net>
X-Complaints-To: usenet AT main DOT gmane DOT org
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106

I added a call to GetCommadLine() to see what it returns. It correctly
quotes the directory with spaces in it, so the caller of WinMain() should
easily be able to handle it.  Win95 does too.

From "/home/cygusr"
GetCommandLine() returns [C:\cygwin\home\bkash\prtcmdline\prtcmdline.exe
arg1 arg]

From "/cygdrive/c/Documents and Settings/cygusr"
GetCommandLine() returns ["c:\Documents and Settings\bkash\prtcmdline.exe"
arg1 arg2]

"Martin" <mgainty AT hotmail DOT com> wrote in message
news:OE19Dc41W2ufyWOxbCJ000162eb AT hotmail DOT com...
> here is the workaround we use in Ant build (which by the way outclasses
> anything any make can do)
> /cygdrive/c/Documents and Settings/cygusr           //becomes
> /cygdrive/c/DOCUME~1\cyguser          //workaround for 95/98 inability to
> handle spaces in directory name
>
> Martin
> ----- Original Message -----
> From: "BB" <canofspam AT att DOT net>
> To: <cygwin AT cygwin DOT com>
> Sent: Friday, April 04, 2003 10:34 AM
> Subject: Bug in GUI App WinMain Arguements
>
>
> > I'm having a problem running a windows gui app with arguments from a
> mounted
> > directory if the Win32Path mounted to contains blanks. (i.e. mount -s -b
> > "C:/foo bar" "/foobar"). It's not a mount specific problem because it
also
> > occurs if the directory has a space in it.  Since mkpasswd defaulted my
> home
> > directory to "/cygdrive/c/Documents and Settings/cygusr", I am assuming
> > Cygwin supports directories with spaces in them.  I have included a
small
> > program that illustrates the bug.
> >
> > By the way, I'm running on XP with the latest version of Cygwin newly
> > installed.
> >
> > Also, according to the "Cygwin Users Guide", I have included the
following
> > line in the code.
> > WinMainCRTStartup() { mainCRTStartup(); }
> > It doesnt seem to be called.  Is the User Guide correct? The same
problem
> > occurs if I omit the line and use the "-e _mainCRTStartup" as suggested
in
> > the User Guide.
> >
> > Any suggestions?
> > BB.
> >
> > Assuming the program listed below (prtcmdline.exe) is in
> > "/cygdrive/c/Documents and Settings/cygusr"...
> >
> > $ cd ~
> > $ pwd
> > /cygdrive/c/Documents and Settings/cygusr
> > $ ./prtcmdline arg1 arg2 | tail -
> > default
> > and Settings\cygusr\prtcmdline.exe" arg1 arg2      << wrong
> > $ cp prtcmdline.exe /home/cygusr
> > $ /home/cygusr/prtcmdline arg1 arg2 | tail -
> > default
> > arg1 arg2                       <<right
> > $
> >
> > /****************************************************/
> > /* prtcmdline.c                                     */
> > /* gcc -mwindows prtcmdline.c -o prtcmdline.exe     */
> > /****************************************************/
> > #include <windows.h>
> > #include <stdio.h>
> >
> > char *gstr = "default\r";
> >
> > WinMainCRTStartup()
> > {
> >  gstr = "WinMainCRTStartup() called\r";
> >  mainCRTStartup();
> > }
> >
> > int APIENTRY WinMain(HINSTANCE hInstance,
> >                      HINSTANCE hPrevInstance,
> >                      LPSTR     lpCmdLine,
> >                      int       nCmdShow)
> > {
> >  puts(gstr);
> >  puts(lpCmdLine);
> >  return 0;
> > }
> > /****************************************************/
> >
> >
> >
> >
> >
> >
> >
> > --
> > Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> > Bug reporting:         http://cygwin.com/bugs.html
> > Documentation:         http://cygwin.com/docs.html
> > FAQ:                   http://cygwin.com/faq/
> >
> >
>




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.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