public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: Xemacs/cygwin 21.4.3 and new console window during compilation
       [not found] <ofr2f1lc.fsf@mail.ru>
@ 2001-12-17 21:57 ` Andy Piper
  2001-12-18  1:09   ` Dmitry Bely
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Piper @ 2001-12-17 21:57 UTC (permalink / raw)
  To: Dmitry Bely, xemacs-winnt; +Cc: ben, cygwin

So my supposition is that a console window is created because XEmacs 
doesn't have one by default when started from the desktop. The reason it 
works in bash is that children inherit their parent's console by default 
and somewhere up the foodchain cygwin has a console. I have no idea how we 
could fix this. I imagine that if we do AllocConsole in the cygwin version 
of XEmacs that whilst this may stop your program creating a console we will 
get an ugly console popping up for XEmacs as a whole. Maybe this is 
acceptable, I don't know. I'm CC'ing ben and the cygwin list to see if any 
windows gurus have any great ideas on this score.

andy

At 07:56 PM 7/3/2001 +0400, Dmitry Bely wrote:
>I have found very strange thing, which is the real showstopper for me. I
>cannot use ocaml compiler (www.ocaml.org) within Xemacs -- when it's called
>during compilation, new console window is always created and so
>warning/error messages are not catched by XEmacs compilation
>process. Having spent enough time, I've managed to extract from ocaml
>sources the following small test example, that demonstrates the problem:
>
>[---hello.c---]
>#include <stdio.h>
>
>int main()
>{
>   printf("Hello, world!\n");
>   printf("press any key...");
>   getchar();
>   return 0;
>}
>[---end of hello.c---]
>
>[---hello-run.c---]
>#pragma comment(linker , "/subsystem:console")
>
>#include <windows.h>
>
>#define msg_and_length(msg) msg , (sizeof(msg) - 1)
>const char* app = ".\\hello.exe";
>
>void main()
>{
>   STARTUPINFO stinfo;
>   PROCESS_INFORMATION procinfo;
>   DWORD retcode;
>
>   stinfo.cb = sizeof(stinfo);
>   stinfo.lpReserved = NULL;
>   stinfo.lpDesktop = NULL;
>   stinfo.lpTitle = NULL;
>   stinfo.dwFlags = 0;
>   stinfo.cbReserved2 = 0;
>   stinfo.lpReserved2 = NULL;
>
>   if (!CreateProcess(app, NULL, NULL, NULL, TRUE, 0, NULL, NULL,
>                      &stinfo, &procinfo)) {
>     HANDLE errh;
>     DWORD numwritten;
>     errh = GetStdHandle(STD_ERROR_HANDLE);
>     WriteFile(errh, msg_and_length("Cannot exec "), &numwritten, NULL);
>     WriteFile(errh, app, strlen(app), &numwritten, NULL);
>     WriteFile(errh, msg_and_length("\r\n"), &numwritten, NULL);
>     ExitProcess(2);
>#if _MSC_VER >= 1200
>     __assume(0); /* Not reached */
>#endif
>   }
>   CloseHandle(procinfo.hThread);
>   WaitForSingleObject(procinfo.hProcess , INFINITE);
>   GetExitCodeProcess(procinfo.hProcess , &retcode);
>   CloseHandle(procinfo.hProcess);
>   ExitProcess(retcode);
>#if _MSC_VER >= 1200
>     __assume(0); /* Not reached */
>#endif
>}
>[---end of hello-run.c---]
>
>Compile both files with MCVS 6.0:
>
>cl hello.c
>cl hello.run
>
>and run resulting hello-run.exe. If you do it via XEmacs shell/compile
>process, new Win32 console window will popup.
>
>Very doubtful that it's cygwin problem, because if hello-run.exe is
>executed from cygwin's sh or bash, new console is not created.
>
>My configuration:
>XEmacs 21.4.3/cygwin (latest binary distribution)
>Cygwin1.dll 1.3.2-1 (latest binary distribution)
>CYGWIN=tty binmode ntsec
>Windows NT 4.0 sp6a
>MSVC 6.0 sp5
>
>Can you reproduce that? Do you have any idea how it can be fixed?
>
>Hope to hear from you soon,
>Dmitry


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Xemacs/cygwin 21.4.3 and new console window during compilation
  2001-12-17 21:57 ` Xemacs/cygwin 21.4.3 and new console window during compilation Andy Piper
@ 2001-12-18  1:09   ` Dmitry Bely
  2001-12-18  7:43     ` Larry Hall (RFK Partners, Inc)
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Bely @ 2001-12-18  1:09 UTC (permalink / raw)
  To: Andy Piper; +Cc: xemacs-winnt, ben, cygwin

Andy Piper <andy@xemacs.org> writes:

> So my supposition is that a console window is created because XEmacs
> doesn't have one by default when started from the desktop.

Why then MSVC-compiled XEmacs does not popup new console in the same
situation? It also seems not to have one by default ...

> The reason
> it works in bash is that children inherit their parent's console by
> default and somewhere up the foodchain cygwin has a console. I have no
> idea how we could fix this. I imagine that if we do AllocConsole in
> the cygwin version of XEmacs that whilst this may stop your program
> creating a console we will get an ugly console popping up for XEmacs
> as a whole. Maybe this is acceptable, I don't know. I'm CC'ing ben and
> the cygwin list to see if any windows gurus have any great ideas on
> this score.
> 
> 
> andy

Hope to hear from you soon,
Dmitry



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Xemacs/cygwin 21.4.3 and new console window during compilation
  2001-12-18  1:09   ` Dmitry Bely
@ 2001-12-18  7:43     ` Larry Hall (RFK Partners, Inc)
       [not found]       ` <003a01c187ea$7e5c4dc0$947ba8c0@TSUNAMI>
  0 siblings, 1 reply; 5+ messages in thread
From: Larry Hall (RFK Partners, Inc) @ 2001-12-18  7:43 UTC (permalink / raw)
  To: Dmitry Bely, Andy Piper; +Cc: xemacs-winnt, ben, cygwin

At 03:11 AM 12/18/2001, Dmitry Bely wrote:
>Andy Piper <andy@xemacs.org> writes:
>
> > So my supposition is that a console window is created because XEmacs
> > doesn't have one by default when started from the desktop.
>
>Why then MSVC-compiled XEmacs does not popup new console in the same
>situation? It also seems not to have one by default ...


Checking the source would provide the definitive answer.  I expect what
you'll find is that a console is created but it's invisible.  That's at
least one simple way to deal with this issue.


Good luck,



Larry Hall                              lhall@rfk.com
RFK Partners, Inc.                      http://www.rfk.com
838 Washington Street                   (508) 893-9779 - RFK Office
Holliston, MA 01746                     (508) 893-9889 - FAX


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Xemacs/cygwin 21.4.3 and new console window during  compilation
       [not found]       ` <003a01c187ea$7e5c4dc0$947ba8c0@TSUNAMI>
@ 2001-12-18 10:11         ` Larry Hall (RFK Partners, Inc)
  2001-12-18 10:41         ` Charles Wilson
  1 sibling, 0 replies; 5+ messages in thread
From: Larry Hall (RFK Partners, Inc) @ 2001-12-18 10:11 UTC (permalink / raw)
  To: Andy Piper, Dmitry Bely; +Cc: xemacs-winnt, ben, cygwin

Look at STARTUP_INFO in the context of CreateProcess:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/prothred_9dpv.asp

You can make the console created invisible by setting dwFlags to 
STARTF_USESHOWWINDOW and wShowWindow to SW_HIDE.

Larry Hall                              lhall@rfk.com
RFK Partners, Inc.                      http://www.rfk.com
838 Washington Street                   (508) 893-9779 - RFK Office
Holliston, MA 01746                     (508) 893-9889 - FAX



At 12:36 PM 12/18/2001, Andy Piper wrote:
>Dumb question - how do you create an invisible console?
>
>andy
>
> > -----Original Message-----
> > From: xemacs-winnt-admin@xemacs.org
> > [mailto:xemacs-winnt-admin@xemacs.org]On Behalf Of Larry Hall (RFK
> > Partners, Inc)
> > Sent: Tuesday, December 18, 2001 7:13 AM
> > To: Dmitry Bely; Andy Piper
> > Cc: xemacs-winnt@xemacs.org; ben@xemacs.org; cygwin@cygwin.com
> > Subject: Re: Xemacs/cygwin 21.4.3 and new console window during
> > compilation
> > 
> > 
> > At 03:11 AM 12/18/2001, Dmitry Bely wrote:
> > >Andy Piper <andy@xemacs.org> writes:
> > >
> > > > So my supposition is that a console window is created because XEmacs
> > > > doesn't have one by default when started from the desktop.
> > >
> > >Why then MSVC-compiled XEmacs does not popup new console in the same
> > >situation? It also seems not to have one by default ...
> > 
> > 
> > Checking the source would provide the definitive answer.  I expect what
> > you'll find is that a console is created but it's invisible.  That's at
> > least one simple way to deal with this issue.
> > 
> > 
> > Good luck,
> > 
> > 
> > 
> > Larry Hall                              lhall@rfk.com
> > RFK Partners, Inc.                      http://www.rfk.com
> > 838 Washington Street                   (508) 893-9779 - RFK Office
> > Holliston, MA 01746                     (508) 893-9889 - FAX
> > 


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Xemacs/cygwin 21.4.3 and new console window during  compilation
       [not found]       ` <003a01c187ea$7e5c4dc0$947ba8c0@TSUNAMI>
  2001-12-18 10:11         ` Larry Hall (RFK Partners, Inc)
@ 2001-12-18 10:41         ` Charles Wilson
  1 sibling, 0 replies; 5+ messages in thread
From: Charles Wilson @ 2001-12-18 10:41 UTC (permalink / raw)
  To: Andy Piper
  Cc: Larry Hall (RFK Partners, Inc), Dmitry Bely, xemacs-winnt, ben, cygwin

Take a look here:

  http://www.neuro.gatech.edu/users/cwilson/cygutils/unversioned/run/

and get the run-1.1.4 sourcecode.  I think it contains the commands you 
want.

--Chuck


Andy Piper wrote:

> Dumb question - how do you create an invisible console?
> 
> andy
> 
> 
>>-----Original Message-----
>>From: xemacs-winnt-admin@xemacs.org
>>[mailto:xemacs-winnt-admin@xemacs.org]On Behalf Of Larry Hall (RFK
>>Partners, Inc)
>>Sent: Tuesday, December 18, 2001 7:13 AM
>>To: Dmitry Bely; Andy Piper
>>Cc: xemacs-winnt@xemacs.org; ben@xemacs.org; cygwin@cygwin.com
>>Subject: Re: Xemacs/cygwin 21.4.3 and new console window during
>>compilation
>>
>>
>>At 03:11 AM 12/18/2001, Dmitry Bely wrote:
>>
>>>Andy Piper <andy@xemacs.org> writes:
>>>
>>>
>>>>So my supposition is that a console window is created because XEmacs
>>>>doesn't have one by default when started from the desktop.
>>>>
>>>Why then MSVC-compiled XEmacs does not popup new console in the same
>>>situation? It also seems not to have one by default ...
>>>
>>
>>Checking the source would provide the definitive answer.  I expect what
>>you'll find is that a console is created but it's invisible.  That's at
>>least one simple way to deal with this issue.
>>
>>
>>Good luck,
>>
>>
>>
>>Larry Hall                              lhall@rfk.com
>>RFK Partners, Inc.                      http://www.rfk.com
>>838 Washington Street                   (508) 893-9779 - RFK Office
>>Holliston, MA 01746                     (508) 893-9889 - FAX
>>
>>
> 



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-12-18 18:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <ofr2f1lc.fsf@mail.ru>
2001-12-17 21:57 ` Xemacs/cygwin 21.4.3 and new console window during compilation Andy Piper
2001-12-18  1:09   ` Dmitry Bely
2001-12-18  7:43     ` Larry Hall (RFK Partners, Inc)
     [not found]       ` <003a01c187ea$7e5c4dc0$947ba8c0@TSUNAMI>
2001-12-18 10:11         ` Larry Hall (RFK Partners, Inc)
2001-12-18 10:41         ` Charles Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).