32Feet.Net in C++ Application?

Topics: Bluetooth - Other, Project Management Forum
Jun 18, 2012 at 5:40 PM

I apologize in advance for my ignorance, but I can't seem to find the answers to my questions on the net. 

Can 32feet.NET be used in a C++ application? Specifically I am trying to integrate Bluetooth support into a Firebreath plugin which is being developed using Cmake and VS2010. 

Any insight would be greatly appreciated.

Thanks.  

Jun 23, 2012 at 11:21 PM

Well after learning a bit more about this .Net world that I have never seen, I was able to ask some more specific questions and find what I needed. 

Just in case anyone else comes across this learning curve, this is the problem I had and how accomplished what I was trying to do:  

The problem:
I had a native, unmanaged, c++ project that I wanted to use the 32feet.NET library in.

My solution:

I first created a .NET (C#) assembly, wrapping up the 32feet.net methods/functionality that I needed to use (connecting, sending, receiving, discovering). For my own sanity I created my methods to have simple input and output types to make converting between managed/unmanaged code easier.

Next I created a managed(clr) c++ class to act as a bridge or shim between my unmanaged project and my .Net assembly. The bridge provided data conversion from unmanaged types to managed types and exposed an api that the unmanaged code could use.


This obviously isn't a complete solution but I would have loved to have found a starting place for trying to use 32Feet.NET in traditional C++. My question really boiled down to how mix unmanaged and managed code.

Other Resources:
http://msdn.microsoft.com/en-us/library/aa712789(v=vs.71)