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

Mike Barry mike.barry@gmail.com
Sat May 13 15:34:00 GMT 2017


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"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.out
Type: application/octet-stream
Size: 42741 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20170513/4b2ac8ea/attachment.obj>
-------------- next part --------------

--
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


More information about the Cygwin mailing list