user14766639
user14766639

Reputation:

How to filter debug output window on visual studio?

How do i remove or filter this kind of message?

This is very annoying and keeps displaying the whole time I cant understand why. Im using visual studio 2019 c++.

Is safer to exit and terminate or stuck the code in a "fake" while loop?
When x condition doesn't meet i will

After reading this line of code: MessageBox(g_hWnd, string.data(), L"", MB_OK | MB_ICONSTOP | MB_SETFOREGROUND | MB_APPLMODAL | MB_TOPMOST);

The message always is displayed:

windows\dwm\dwmapi\attribute.cpp(105)\dwmapi.dll!00007FFBE41B1940: (caller: 000000018000E820) LogHr(1) tid(83b8) 80070006 Identificador inválido.

But if I remove MB_ICONSTOP and use only: MessageBox(g_hWnd, string.data(), L"", MB_OK | MB_SETFOREGROUND | MB_APPLMODAL | MB_TOPMOST);it does not display.

It is also displayed by other things that I didn't know.

Some google: https://social.msdn.microsoft.com/Forums/en-US/3a5a145a-c13d-4898-bb61-a5baadc9332f/why-am-i-getting-hundreds-of-weird-messages-in-debug-output-window?forum=vcgeneral

https://developercommunity.visualstudio.com/content/problem/258494/windowsdwmdwmapiattributecpp92dwmapidll72ed3cf4-ca.html

Upvotes: 5

Views: 1394

Answers (2)

user14766639
user14766639

Reputation:

I have added #include <Dwmapi.h> and now it's not spamming that message in the debug console anymore.

https://learn.microsoft.com/en-us/windows/win32/api/dwmapi/nf-dwmapi-dwmgetwindowattribute

I think the error was because it was not loading the lib dwamip.dll.

Upvotes: 1

bythescruff
bythescruff

Reputation: 1899

This is an example of an XY Problem, also discussed here. Instead of trying to prevent the messages from being shown, it would be better to prevent them from being generated in the first place.

Judging by the links you posted, this problem has existed for a few years and has bothered many people. Fortunately your first link appears to have a workaround: the post by user "codeviewer" lists a function called suppress_dwmapi_output() which when added to your code and called from InitInstance() will apparently prevent these messages from being created.

Disclaimer: I haven't tried this myself.

Upvotes: 1

Related Questions