2.3 KiB
← Back to Twitter thread index
title: "So instead of the massive "mmdeviceapi.h" mess-ware, I defined a stupid CPP_(obj" author: "NOTimothyLottes" handle: "@NOTimothyLottes" post_url: "https://x.com/NOTimothyLottes/status/2073110092447203466" post_id: "2073110092447203466" timestamp: "2026-07-03 18:22:17" post_count: 6 reply_count: 1 repost_count: 0 like_count: 3 view_count: 225
@NOTimothyLottes — So instead of the massive "mmdeviceapi.h" mess-ware, I defined a stupid CPP_(obj
Post 1 (2026-07-03 17:26:33)
Following the succession (thanks) of re-trying WASAPI using this example which has been pre-minimized and de-C++'ed: https://gist.github.com/mmozeiko/5a5b168e61aff4c1eaec0381da62808f#file-win32_wasapi-h - But I'm missing something on how to get the C++ as C linking to function (cross compiling), doesn't easily work out of the box.
Post 2 (2026-07-03 17:37:48) — reply to Post 1
Of course I'm missing the magic header that does the real work ... curious how messy this will get
Post 3 (2026-07-03 18:22:17) — reply to Post 2
So instead of the massive "mmdeviceapi.h" mess-ware, I defined a stupid CPP_(object,virtual_function_number) macro. This way I just have to write down the index in the VT table for the specific virtual function ...
Post 4 (2026-07-03 18:27:11) — reply to Post 3
Here is initial bring up, function call by function call. No headers, and no C++. The magic of typecasting at usage IC4_(CPP_(... is that I don't ever have to build the headers. That is at least working out well. I do line by line to test in Wine, defer fail handling until later
Post 5 (2026-07-03 18:35:35) — reply to Post 4
More on bring-up. I just run and check visually for output in the console (this time 'B055'). Since compile times are under a second, it is super fast to check as I go. Easy to see how much code bloat there is for C++ this way (doing it manually).
Post 6 (2026-07-03 18:39:26) — reply to Post 5
Example below of how much header bloat I'm factoring out using my simple macros





