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
相关阅读
用scala 算一个东西, out of memory 了,怎么办?下一波世界革命,是小札等科技巨头忽悠P民推翻政客 (转载)比较spring-boot 和 node.jschrome 如何停止video auto play ?会用c#/python program MSSql, Excel, 从网上抓数据,合适做啥工作?请问,有没有一种算法或者软件可以youtube search by content?看了一下vue,感觉就是angularjs的弟弟看了一点kafkauber和当年的apple有点象了,头头被政治斗争赶走了。如何train一个把签名(手写)与印刷字体区别的model?挖得太慢了 (转载)d3值不值得学?觉得ML在business里面没多大作用python下怎么解决GIL?AWS上做Deep learning large scale designreactive native deploy errorJava 多线程:还需要好CPU?Angularjs + Spark ?怎么对付老邢的验证码?有人用react + redux么