Web lists-archives.com

Re: BUG: winmain GetCommandLine only returning program name and path with no arguments




Greetings, Mike Barry!

> Below is a sample program that demonstrates that the GetCommandLine
> function is not returning the command line arguments.  I attached
> cygcheck.out.

> #include <windows.h>
> #include <stdio.h>

> int WINAPI
> WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw) {
>         char* text = GetCommandLine();
>         printf("getcmdline: %s\n", text);
>         return 0;
> }

> gcc test_wmain.c -o test

> $ ./test hello world
> getcmdline: "C:\cygwin64\home\mbarry\game-repos\greenbeam\src\test.exe"

What about CYGWIN=wincmdln ?


-- 
With best regards,
Andrey Repin
Saturday, May 13, 2017 19:05:36

Sorry for my terrible english...


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple