About Us Knowledge Base Community Forum Electronics Toolbox FAQ Shipping & Delivery

Community Forum

Share your projects and post your questions

Register or Sign In

Using the provided Win10 IoT libraries in C++/CX UWP app?

1773 Views - Created 17/08/2016


Posted by:

Users Avatar

I can't seem to find a way to integrate the provided C# class library into a UWP C++/CX app. Is there a way to do this?

I tried including the project in my solution and then referencing it in my C++/CX app, but it fails to find the ABElectronics_Win10IOT_Libraries namespace when compiling the C++/CX code.



Posted by:

Last edited: 18/08/2016

Users Avatar

After further review it appears I have to change the output type of the project to "Windows Runtime Component" instead of "Class Library".

Then it requires some code changes such as no "Task" return type and I couldn't quickly figure out how to make the "Connected" event compatible -- so I deleted it. However, with those deletions it linked with my C++/CX code using nothing but a reference to the project.

EDIT: At runtime it crashes and burns with a null activation factory (3rd argument) to GetActivationFactoryByPCWSTR() when you try to create a new port with "ref new IOPi()". I could not figure out how to make it work at this time.

Perhaps consider making modifications to the libraries to allow linking with C++/CX code. Microsoft provides several of the Win10 IoT examples in both C# and C++/CX languages.


Posted by:

Users Avatar

United Kingdom

Users Twitter  Users Website  

I don't have any experience with writing Windows C++/CX applications so I will need to do some research but I will see if it is possible to make the Windows IOT libraries compatible.

AB Electronics UK Tech Support

Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view, download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.