Qt-interest Archive, March 2002
way to find cwd in windows?
Message 1 in thread
- Subject: way to find cwd in windows?
- From: Jeff Shipman <shippy@xxxxxxx>
- Date: Mon, 18 Mar 2002 19:14:56 -0700
- Organization: New Mexico Institute of Mining and Technology
- To: Qt Mailing List <qt-interest@xxxxxxxxxxxxx>
If I'm running my program from c:\blah\foo\myprog.exe,
is there a way I can find the c:\blah\foo in
Qt? A cross-platform way is a plus, but it really
doesn't matter because I already have a solution
for under Linux.
Thanks in advance,
--
[ signature omitted ]
Message 2 in thread
Hi!
Have you tried to use QDir::current(), etc?
Best regards,
Dima Ivanets
-----Original Message-----
From: owner-qt-interest@trolltech.com
[mailto:owner-qt-interest@trolltech.com]On Behalf Of Jeff Shipman
Sent: Tuesday, March 19, 2002 4:15 AM
To: Qt Mailing List
Subject: way to find cwd in windows?
If I'm running my program from c:\blah\foo\myprog.exe,
is there a way I can find the c:\blah\foo in
Qt? A cross-platform way is a plus, but it really
doesn't matter because I already have a solution
for under Linux.
Thanks in advance,
--
[ signature omitted ]
Message 3 in thread
int main (int argc, char** argv)
{
... argv[0]
}
argv[0] is the full path and application name. Just strip the trailing app
name.
-----Original Message-----
From: Jeff Shipman [mailto:shippy@nmt.edu]
Sent: Monday, March 18, 2002 6:15 PM
To: Qt Mailing List
Subject: way to find cwd in windows?
If I'm running my program from c:\blah\foo\myprog.exe,
is there a way I can find the c:\blah\foo in
Qt? A cross-platform way is a plus, but it really
doesn't matter because I already have a solution
for under Linux.
Thanks in advance,
--
[ signature omitted ]
Message 4 in thread
hello.every one
I am now working on QT for arm, I want a c++ compiler for arm,
I wonder if linux-ipag-g++ is right for all arm core?
and where can I get it ?
Thanks
Jimmy
Message 5 in thread
On Tue 19. March 2002 03:28, you wrote:
> If I'm running my program from c:\blah\foo\myprog.exe,
> is there a way I can find the c:\blah\foo in
> Qt? A cross-platform way is a plus, but it really
> doesn't matter because I already have a solution
> for under Linux.
>
> Thanks in advance,
> int main (int argc, char** argv)
> {
> ... argv[0]
> }
>
> argv[0] is the full path and application name. Just strip the trailing app
> name.
Not really. This is what you've typed in command line. Of course when running
from start menu or from icon it will be full path + program name, but you can
always run command.com and type:
c:\> cd <path>
c:\<path>\> program.exe
In that case QString(argv[0]) == QString("program.exe").
<b>Solutions: </b>
QString QDir::currentDirPath () [static]
QDir QDir::current () [static]
--
[ signature omitted ]
Message 6 in thread
Hi !
If you only need it on Windows you can use GetModuleFileName( NULL, ptr, n),
this returns the full path including filename in the ptr buffer.
Mikael
----- Original Message -----
From: "Mariusz Lotko" <mariusz.lotko@pruftechnik.com.pl>
To: "Qt Mailing List" <qt-interest@trolltech.com>
Sent: Tuesday, March 19, 2002 8:08 AM
Subject: Re: way to find cwd in windows?
> On Tue 19. March 2002 03:28, you wrote:
> > If I'm running my program from c:\blah\foo\myprog.exe,
> > is there a way I can find the c:\blah\foo in
> > Qt? A cross-platform way is a plus, but it really
> > doesn't matter because I already have a solution
> > for under Linux.
> >
> > Thanks in advance,
>
> > int main (int argc, char** argv)
> > {
> > ... argv[0]
> > }
> >
> > argv[0] is the full path and application name. Just strip the trailing
app
> > name.
>
> Not really. This is what you've typed in command line. Of course when
running
> from start menu or from icon it will be full path + program name, but you
can
> always run command.com and type:
> c:\> cd <path>
> c:\<path>\> program.exe
>
> In that case QString(argv[0]) == QString("program.exe").
>
> <b>Solutions: </b>
> QString QDir::currentDirPath () [static]
> QDir QDir::current () [static]
>
> --
> Mariusz Lotko
> Pruftechnik Technology sp. z o. o.
> http://www.pruftechnik.com.pl/
>
> --
> List archive and information: http://qt-interest.trolltech.com