Board index » Visual Studio » How to create a console while running MFC

How to create a console while running MFC

Visual Studio301
Hi,

I want to show some information of an application.

Anyone knows how to dump a console while the major MFC application is

running?

Thanks in advance

Jack


-
 

Re:How to create a console while running MFC

"Jacky Luk" wrote:

Quote
I want to show some information of an application.

Anyone knows how to dump a console while the major MFC

application is running?





KB105305 - "INFO: Calling CRT Output Routines from a GUI

Application"

support.microsoft.com/kb/105305/en-us">support.microsoft.com/kb/105305/en-us



HTH

Alex





-

Re:How to create a console while running MFC



Jacky Luk wrote:

Quote
Hi,

I want to show some information of an application.

Anyone knows how to dump a console while the major MFC application is

running?

Thanks in advance

Jack



AllocConsole



Arnaud

MVP - VC



-

Re:How to create a console while running MFC

Hi,

Could you please take me a little bit further?

cos _O_TEXT is not recognised and besides



c:\Documents and Settings\luckie\app1\app1\app1.cpp(97): error C2065:

'_open_osfhandle' : undeclared identifier



while I place the MS code into InitInstance() of my Application module

Thanks

Jack





"Jacky Luk" <jl@knight.com>¼¶¼g©ó¶l¥ó·s»D:eXdkIiV3GHA.4588@TK2MSFTNGP04.phx.gbl...

Quote
Hi,

I want to show some information of an application.

Anyone knows how to dump a console while the major MFC application is

running?

Thanks in advance

Jack







-

Re:How to create a console while running MFC

"Jacky Luk" wrote:

Quote
Could you please take me a little bit further?

cos _O_TEXT is not recognised and besides



c:\Documents and Settings\luckie\app1\app1\app1.cpp(97):

error C2065: '_open_osfhandle' : undeclared identifier



while I place the MS code into InitInstance() of my

Application module





#include <io.h>





-

Re:How to create a console while running MFC

Trivial:



AllocConsole ();

freopen ("CON", "w", stdout);



Then just use printf or puts or whatever.



- Alan Carre



"Jacky Luk" <jl@knight.com>wrote in message

Quote
Hi,

I want to show some information of an application.

Anyone knows how to dump a console while the major MFC application is

running?

Thanks in advance

Jack







-

Re:How to create a console while running MFC

"Jacky Luk" <jl@knight.com>wrote:



Quote
Hi,

Could you please take me a little bit further?

cos _O_TEXT is not recognised and besides



c:\Documents and Settings\luckie\app1\app1\app1.cpp(97): error C2065:

'_open_osfhandle' : undeclared identifier



while I place the MS code into InitInstance() of my Application module



You MUST learn, Jacky: As nice as we all are, Google is much, much faster

than this newsgroup.

--

- Tim Roberts, timr@probo.com

Providenza & Boekelheide, Inc.

-