From: ebritten@uci.edu (Eric Britten)
Subject: Re: argv[0] has no full path name on winnt
13 Jul 1997 18:29:46 -0700
Sender: mail@cygnus.com
Approved: cygnus.gnu-win32@cygnus.com
Distribution: cygnus
Message-ID: <33C971AA.AB50A045.cygnus.gnu-win32@uci.edu>
References: <199707132243.RAA10748@www.intur.net>
X-Mailer: Mozilla 4.01 [en] (Win95; I)
MIME-Version: 1.0
Original-To: Nick Shaffner <nshaf@intur.net>
Original-CC: Arlindo da Silva <dasilva@woodmore.gsfc.nasa.gov>, gnu-win32@cygnus.com
X-Priority: 3 (Normal)
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Original-Sender: owner-gnu-win32@cygnus.com

Nick Shaffner wrote:

> > I have this wrapper application which uses argv[0] to figure out the
>
> > directory where it was been installed, setting up all the other
> > necessary enviroment variables before firing up the main
> > application. Well, this works on win95; on winnt argv[0] returns
> only
> > the first token on the command line (without the full pathname). Is
> > there a way to get full pathname of the executable that works on
> both
> > win95 AND winnt?
> >
> > Any help greatly appreciated.
>
> Try the GetCommandLine() funciton ( not sure of exact name )
> --
> Nick Shaffner
> http://users.intur.net/~nshaf/
>

   If GetCommandLine doesn't work, then use GetModuleFileName

GetModuleFileName(NULL, exepath, exepathlength);

Eric Britten

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".
