DTK Static Linking then Redistribution

Jun 19, 2013 at 6:20 PM
Hi,

I am using the DirectX Toolkit for Windows Phone to do some sprite drawing. The DTK is referenced by Windows Phone Runtime component and all is working well with call through my WinPRT. However, when I try to redistribute my WinPRT DLL (use it in a separate solution outside of the one it builds in), I get a runtime ArgumentException stating “The parameter is incorrect” if any types from the DTK are accessed/instantiated. If I comment out the DTK code, my DLL redistributes and runs fine.

Do you have any idea on the best way to go about distributing my WinPRT DLL and getting it to work correctly with DTK? I was under the impression that my WinPRT DLL would contain all it needed to work on its own.


Best,
  • Chevon
Coordinator
Jul 3, 2013 at 6:50 AM
Edited Jul 3, 2013 at 6:54 AM
DirectXTK is a static library and has no redistribution requirement.

While the library is compatible for use in WinRT applications for both Windows phone and Windows Store apps, it's not actually a WinRT component. As such the 'native' types implemented by DirectXTK are not WinRT types, they are C++ types. You should limit your WinRT interfaces to WinRT types and use DirectXTK only 'internally' to your authored WinRT component.

Be sure to read the MSDN docs on this topic.
Jul 4, 2013 at 3:10 AM
I am aware of this. I was not asking about a requirement, but redistribution methods. In any case, I found a work around
Coordinator
Jul 4, 2013 at 10:59 AM
Any details on the workaround? I'm still not entirely clear from the original post what exactly the problem was that you were encountering.
Jul 4, 2013 at 5:49 PM
Edited Jul 4, 2013 at 5:51 PM
As stated - The DTK is referenced by Windows Phone Runtime component, which is reference by a final app (All are projects in the same solution). All is working well when I call from my app through my WinPRT, which calls DTK. However, when I try to redistribute my WinPRT DLL (take the DLL and DTK compiled lib and try to use it in a separate solution outside of the one it builds in), I get a runtime ArgumentException stating “The parameter is incorrect” if any types from the DTK are accessed/instantiated. If I comment out the DTK code, my DLL redistributes and runs fine.

-Work around is to compile in the source files of DTK into your WinPRT project.
Coordinator
Jul 4, 2013 at 7:23 PM
Can you post an example of the "DTK" code you are using when you state "and try to use it in a separate solution"?