CnPack Forum


 
Subject: bcb 使用CnConsole
fbms
新警察
Rank: 1



UID 39864
Digest Posts 0
Credits 32
Posts 12
点点分 32
Reading Access 10
Registered 2008-4-25
Status Offline
Post at 2011-12-20 09:21  Profile | Blog | P.M. 
bcb 使用CnConsole



void WriteLn(String text)
{
  static HANDLE handle;
  if (!handle) {
    AllocConsole();
    handle = GetStdHandle(STD_OUTPUT_HANDLE);
  }
  text += "\n";
  WriteConsole(handle,
    text.c_str(), text.Length(), 0, 0);
}

//---------------------------------------------------------------------------
void __fastcall TForm1::CnButton1Click(TObject *Sender)
{
WriteLn ("this is a test");
}

Top
fbms
新警察
Rank: 1



UID 39864
Digest Posts 0
Credits 32
Posts 12
点点分 32
Reading Access 10
Registered 2008-4-25
Status Offline
Post at 2011-12-20 09:23  Profile | Blog | P.M. 
。。。其实不放cnconsole一样弹出来控制台,囧。
Top
Passion (LiuXiao)
管理员
Rank: 9Rank: 9Rank: 9


UID 359
Digest Posts 19
Credits 6636
Posts 3497
点点分 6636
Reading Access 102
Registered 2004-3-28
Status Offline
Post at 2011-12-20 17:11  Profile | Blog | P.M. 
CnConsole组件确实就是对AllocConsole等API的封装。
Top
 




All times are GMT++8, the time now is 2022-1-25 00:24

    本论坛支付平台由支付宝提供
携手打造安全诚信的交易社区 Powered by Discuz! 5.0.0  © 2001-2006 Comsenz Inc.
Processed in 0.014402 second(s), 7 queries , Gzip enabled

Clear Cookies - Contact Us - CnPack Website - Archiver - WAP