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
相关阅读
哪里有比较全的对比:比如说 Java ArrayList 就是 C++ vector为啥没有javascript版?dropout是不是喝dropgrad等价?大家合作喜欢找基础好,不太聪明的做软件开发的甲方/需求方 就像对付装修队魏老师的产品不适用Java其实也是前后端通吃的...[bssd]给大家贡献几个实际项目的情况感觉Win10对中文的支持严重变差了啊码工应如何抵御经济萧条看看这个怎么做golang还有很长的路需要走,需要5年到10年吧我应该用什么语言或者framework?这本书推荐给大家老魏看过来请教怎么把几千行的源代码图形化便于理解?人的记忆真的很有意思.net C# 有没有类似 go goroutine 的 库 或者框架 ??神学的问题请教Amazon上的smart plug一直在on sale (转载)