This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Help Option


Robert Collins wrote:
On Mon, 2002-11-25 at 13:51, Earnie Boyd wrote:

Robert Collins wrote:

IIRC -mwindows builds don't get a console, so can't output command line
help.

That doesn't mean you can't create one.

Which results in a popup window right? Which is -effectively- gui help
for command line options, right back where we started.

That depends on how it's coded. The -mwindows switch alone doesn't cause the abscense of stdio.

<foo.c>
#include <stdlib.h>
#include <stdio.h>
#include <windows.h>

int WINAPI WinMain (
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpszCmdParm,
int nCmdShow
)
{
printf("stdout\n");
fprintf(stderr, "stderr\n");
}
</foo.c>
<build>
g++ -o foo foo.C -mwindows
</build>

If you wanted you could even use the Win32 API WriteFile function.

HANDLE hStdout = (HANDLE)_get_osfhandle (_fileno (stdout));
WriteFile (hStdout, ...

Earnie.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]