🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #10439

Re: Console Window in GUI App Acts Differently Outside Debugger

#10439
From: James R. Brown
Date: Thu, 08 Apr 2004 15:03
37 lines
2303 bytes
The following code does not use the VCL.  It is used for both GUI and
console apps.  It works for console apps from within and outside of the
debugger; however, it only works for GUI apps from within the debugger...

   m_Handle       = GetStdHandle(STD_OUTPUT_HANDLE);
   if (!m_Handle)
      {
      if (AllocConsole())
         {
         sm_oLogFile.WriteDebugEntry("Console window created
successfully",AMF_AF_LogFileC::DL_MINIMAL);
         m_Handle = GetStdHandle(STD_OUTPUT_HANDLE);
         if (!m_Handle)
            AMF_BaseC_REPORT_WARNING("Console window created successfully
but could not retrieve its handle!");
         }
      else
         AMF_BaseC_REPORT_WARNING("Console window could not be created!");
      }


Bob Gonder wrote:

> James R. Brown wrote:
>
> >I have a GUI (VCL) app that allocates a console window in addition to
> >its main form.  This works fine under the debugger but the console
> >window never shows up when run outside the debugger.  Can anyone offer
> >an explanation why this is happening?
>
> Probably need to see the code that creates the console.
> Highest probability is you aren't properly initializing something.
>
> >I  wasn't sure which newsgroup to post this.
>
> Unless the console creation is VCL , then one of the VCL groups might
> be better.
Technical Details
Message-ID: <407569BC.BAB4157F@jhuapl.edu>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <40742CF5.272A543D@jhuapl.edu> <918970dunp80oqf0houn4gtr4qb78td9e7@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,ca514572bb0f75e3
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2004-04-08 08:05:14 PST
Message-ID: <407569BC.BAB4157F@jhuapl.edu>
Date: Thu, 08 Apr 2004 11:03:24 -0400
From: "James R. Brown" <james.brown@jhuapl.edu>
X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Console Window in GUI App Acts Differently Outside Debugger
References: <40742CF5.272A543D@jhuapl.edu> <918970dunp80oqf0houn4gtr4qb78td9e7@4ax.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 128.244.83.32
X-Trace: newsgroups.borland.com 1081436604 128.244.83.32 (8 Apr 2004 08:03:24 -0800)
Lines: 38
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail