高分求在atl进程外服务中使用cout及printf向屏幕输出的方法
如下
extern "C" int WINAPI _tWinMain(HINSTANCE hInstance,
HINSTANCE /*hPrevInstance*/, LPTSTR lpCmdLine, int /*nShowCmd*/)
{
cout << "????????" << endl;
printf("!!!!!!!\n");
AllocConsole();
DWORD dw;
WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE), "hello", 5, &dw, 0);
现在发现只有用WriteConsole才能看到输出,而cout以及printf的输出被导向output窗口的build窗格中