For use with C#

Oct 6, 2014 at 7:24 PM
I'm using SlimDX for my project, so I need to be able to reference this from a C# project. C# cannot use .lib files. So I tried changing the DXTK project's output type to DLL. I tried to reference it that way, but I still got "A reference to 'DirectXTK_Desktop_2012' could not be added." Then I tried selecting Browse to manually look for the dll. I got, "A Reference to DirectXTK.dll could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component."
Coordinator
Oct 6, 2014 at 8:12 PM
Edited Oct 6, 2014 at 8:14 PM
The DirectX Tool C++ classes are not designed to be directly usable by C#. They are not COM objects, not "flat" C APIs, and are not derived from IUnknown.

You can of course create a DLL with C# interop compatible APIs, and in the implementation of those APIs make use of DirectX Tool Kit library. This wrapper DLL would probably be easiest done with "flat" C APIs.

Note that SharpDX is already borrowing some of the DirectX Tool Kit code, so you may find that useful.
Marked as answer by walbourn on 10/7/2014 at 4:01 PM