On Thu, Feb 28, 2008 at 1:53 PM, Keith Bauer <[EMAIL PROTECTED]> wrote:
> On Mac OS X CFBundle knows how to find the absolute path of the
> executable.  On Linux one can read the symbolic link /proc/self/exe.
> On Windows if you open an app from the GUI, the CWD is the one
> containing the executable, but if you run it on the command-line
> that's presumably not the case... and on other OSes, I don't know of
> any way other than Gordon's suggestion of searching PATH for argv[0].
>
> -Keith

On Windows, I've found using GetModuleHandle(0) and GetModuleFileName
to work fairly well.
I am not sure it works in all cases, but might be a good starting point.

-Matthew Jimenez
_______________________________________________
cfe-dev mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

Reply via email to