Run in debug mode

Description:
I will firstly describe what I’m trying to do. All this is my pet project, so it doesn’t matters on cleanliness of final solution. I wish to notify my other app whenever any user mute/unmute theirs mics. I’m absolutely new in C++ (my native language is java or C#). I understand, that is quite dummy question, and it will probably have its roots in my poor knowledge of topic. But I would like to ask you for help with start. I found the place where I should start coding and tried to add simple print out. But it doesn’t work. I tried to popup error message, but it doesnt work as well. And I could not find any misstake in my added code:


Method is in sdk_util.h.
Nothing happnes after I (or other participants in iniciated call) click to theirs “mute mic icon”. What am I missing?
I run my app from relase configuration, because it crash from debug (running as debuge could solve my difficulty as well). What could I do to see any output (printed output to console, messagebox, debug mode or anything else)? Is there some topic about it?

Versions:

  • SDK for windows, version: v5.2.42037.1112
  • IDE: VS2019
  • Device Spec: PC, Asus
  • OS: Windows 10 Pro
  • Version 2004

Hey @nertht!

Thanks for using the dev forum!

There are no dummy questions. If anything, asking “dummy” questions is the fastest way to get better. :slight_smile:

Unfortunately, the SDK can only run in release mode. However, there is a way to see if your callback is being triggered. Inside of your onAudioBtnClicked function, add __debugbreak(); This will stop the the application at that point, similar to a breakpoint. You can also put __debugBreak(); in your WinMain to see how it works. If your application does not pause at __debugBreak(); when you click the button, the callback is likely set up incorrectly. Which we can troubleshoot after.

std::cout does not behave the same way in c++ Windows GUI applications as it does in c++ console applications, so you wont see those print statements unless you add functionality for it. However, you can make a test text file that std::cout can write to. This stackOverFlow post explains this well: https://stackoverflow.com/a/191912

Can you try this and let me know what happens, then we can troubleshoot from there?

Thanks!
Michael

1 Like

Thanks for such a great answer :slight_smile: Everything is ok now. I found that I was doing wrong thing in the wrong place. Right spot to do the job was not virtual function. After reading some basics about C++ is it clear, that virtual function is just (as it said) virtual representation of function. So I found this: image in custom_ui_mgr.cpp file. And that do excatly the job I need. Breakpoits work fine. It makes my day.
Thanks for all your support.
Petr K.

2 Likes

Hey @nertht,

Awesome! Nice work, I am glad you got it working!
Please let us know if you have any other questions :slight_smile:

Thanks!
Michael

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.