Using DirectX Dinput8.dll directly in C#
I'm coding and app that requires access to DirectX in C#. Specifically it needs access to Dinput8.dll 's DirectInput8Create function.
I'm actually doing some hooking.. and am currenty just trying to hook the call and pass it through.开发者_如何学Go I am only having issues with finding the correct variable types for the DLL call.
I just had a brainwave and think I will need to use Unsafe to make it work.. but I'm not 100% sure.
Sorry to bump an old post, but for people who are looking for why this hook crashes, it appears as though the hooked function is being called from within the hook. This creates an overflow.
I'm not sure why you went straight into hooking... So I might be missing something due the vagueness of the question.
If you want to hook DirectX from c# that's one thing... But if you just want real access to the DX,Direct Input then I'd just use SharpDX...
I've used it before, specifically with Direct Input to get direct access to an Xbox controller connected to a windows PC and the experience was perfectly friction-less.
精彩评论