# Issue with concurrent MIDI and BLE connections \[WinRT/C++\]

**URL:** <https://forum.juce.com/t/issue-with-concurrent-midi-and-ble-connections-winrt-c/42055>\
**Category:** Windows\
**Created:** [October 5, 2020, 11:36am UTC](https://forum.juce.com/t/issue-with-concurrent-midi-and-ble-connections-winrt-c/42055 "2020-10-05T11:36:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dingari-2](https://avatars.discourse-cdn.com/v4/letter/d/58f4c7/32.png) [@dingari-2](https://forum.juce.com/u/dingari-2)\
**Post date:** [October 5, 2020, 11:36am UTC](https://forum.juce.com/t/issue-with-concurrent-midi-and-ble-connections-winrt-c/42055/1 "2020-10-05T11:36:31Z")

</div>

Hey everyone!

This is not specifically related to the JUCE library itself, but I still think this topic is appropriate for this forum.

My team has been struggling with a pretty strange issue while using the WinRT/C++ APIs for Windows to connect to both a MIDI port and receive BLE notifications through a proprietary service on the same device.

The WinRT/C++ library itself is pretty nice and provides easy and modern C++ interfaces to access the managed Windows runtime classes. I’ve even ported the [JUCE WinRT MIDI](https://github.com/dingari/JUCE/blob/winrt-ble-midi/modules/juce_audio_devices/native/juce_win32_Midi.cpp) implementation on my JUCE fork to use WinRT/C++ (which is now recommended by Microsoft over the older WRL/ComPtr based approach). I got rid of about 400 LOC and there is probably still room for improvement.

That being said, we’ve been struggling with a pretty strange issue for the past weeks and we’d love some insight. I’ve pushed a [sample repo](https://github.com/dingari/winrt-midi-test) to Github. The code is heavily inspired by the [JUCE WinRT MIDI](https://github.com/juce-framework/JUCE/blob/master/modules/juce_audio_devices/native/juce_win32_Midi.cpp) implementation.

If any of you are willing to check it out and lend your thoughts, the [readme](https://github.com/dingari/winrt-midi-test/blob/master/README.md) goes through the problem in detail. We’re at quite a standstill 😕

Best,  
Daniel
