n*a
2 楼
You can do that. All you need to do is to REDIRECT the input/output to
stdout/stdin.
You can use WIN32 API
BOOL WINAPI AllocConsole(void)
to allocate a console for the calling process (/DLL).
Further you can wrap in a class
CConsole:: CConsole()
{
AllocConsole();
freopen("CONOUT$","w+t",stdout);
freopen("CONIN$","r+t",stdin);
}
CConsole:: ~CConsole()
{
fclose(stdout);
fclose(stdin);
FreeConsole();
}
Then when you initialize your DLL, you create an instance of CConsole
stdout/stdin.
You can use WIN32 API
BOOL WINAPI AllocConsole(void)
to allocate a console for the calling process (/DLL).
Further you can wrap in a class
CConsole:: CConsole()
{
AllocConsole();
freopen("CONOUT$","w+t",stdout);
freopen("CONIN$","r+t",stdin);
}
CConsole:: ~CConsole()
{
fclose(stdout);
fclose(stdin);
FreeConsole();
}
Then when you initialize your DLL, you create an instance of CConsole
相关阅读
版上有CS 学位的 有多少能写个最简单的compiler?感觉flink出来之后,hadoop就显得不怎么再需要了How to Search Users within 50 miles away from mefangtuo2 4月份发完那贴之后,进去修了bugs没有?网站被黑,烙印外包成功把责任推到了中国头上 (转载)据说金牌卧底被干掉了SublimeREPL里设置Python的PDBCurrentFile报错找不到有公司用Haskell吗?当年号称的PSD一家比一家烂,全是垃圾型startup。 (转载)Perl程序员工作机会多吗?[吐槽]抽象真是不一定好ruby也就适合startup的快糙猛现在 online latex也挺好用了Meteor框架的坑有哪些朋友跳了?Swift 要开源了,不知道和scala比怎么样?寻IOS开发伙伴有啥arm linux可以用的轻量js IDE吗?问个C++的operator conversation function问题看了flink,不能不说有点小期待Linux Makefile: How to include cpp files in subfolder for (转载)