How do I write to the VB6 immediate window from C++ based COM object?

谁都会走 提交于 2020-01-17 05:04:32

问题


I have developed a C++ based COM object to use it in a VB6 application. Now I need to add some logging to catch some of the bugs. I discovered from the answer to 'How to debug COM object in Visual Studio 6.0' question that I can use the OutputDebugString function. But is it possible to write to the VB6 immediate window somehow?


回答1:


Rather than attempting to write to the immediate window, it would be generally more useful to use DebugView from Sysinternals (now part of Microsoft technet):

DebugView is an application that lets you monitor debug output on your local system, or any computer on the network that you can reach via TCP/IP. It is capable of displaying both kernel-mode and Win32 debug output, so you don't need a debugger to catch the debug output your applications or device drivers generate, nor do you need to modify your applications or drivers to use non-standard debug output APIs.

You can use this during development and also in production.

Under Windows 2000, XP, Server 2003 and Vista DebugView will capture:

  • Win32 OutputDebugString
  • Kernel-mode DbgPrint
  • All kernel-mode variants of DbgPrint implemented in Windows XP and Server 2003



回答2:


I don't think you can write direct to it but you can use a COM event that just contains a debug.print call.



来源:https://stackoverflow.com/questions/7384976/how-do-i-write-to-the-vb6-immediate-window-from-c-based-com-object

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!