In a console application, argv[0] is the current filepath of the exe..
is there anything similar to this in a Win32 Application which does not has main?
In a console application, argv[0] is the current filepath of the exe..
That is not true.
argv[0] is just the command used to invoke the program. If run from the commandline, it likely will not be the full path of the exe unless the user actually typed in the full path.
When run from Windows Explorer (by double-clicking on the exe), it's likely that explorer launches the program with the full pathname... but you should not rely on argv[0] always being the full path, because it isn't.
is there anything similar to this in a Win32 Application which does not has main?
If you need to get the full path to the current exe, use GetModuleFileName:
EDIT: also, you really should throw VC++6 away and get a more recent compiler. VC++6 is pre-standard so it can't compile a lot of valid C++ code... and code that you write for it likely will not compile in modern compilers.
Win32 App has Winmain, does it has anything like argv[0]?
i will use GetModuleFileName but argv[0] is much simpler..
also, you really should throw VC++6 away and get a more recent compiler. VC++6 is pre-standard so it can't compile a lot of valid C++ code... and code that you write for it likely will not compile in modern compilers.
i agree with you, which compiler would you recommend?