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 6838
Posts 3591
点点分 6838
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 2024-11-23 23:22

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

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