none
C#, C++/CLI and DirectX question RRS feed

  • Question

  • Hi all.

    I've got a C# program that uses Managed DirectX and i want to convert it to C++/CLI (with Instant C++) as first step to convert it to native C++ pseudo-manually. My question is... will i be able to use the native DirectX library with C++/CLI? or will i have to use a DirectX version wrapped to C++/CLI? (or whatever).

    I'll appreciate any information.

    Thanks in advance.

    Friday, July 9, 2010 10:51 AM

Answers

  • Hi Mawero

    You can use the native DirectX library in C++/CLI. In C++/CLI you can mix managed C++ und unmanaged C++. This means you can access the native library with unmanaged C++ in a managed function which can be used from any .net code. C++/CLI is a perfect solution for this native wrapper things.

    regards

    • Marked as answer by Mawero Friday, July 9, 2010 2:39 PM
    Friday, July 9, 2010 2:05 PM

All replies

  • Hi Mawero

    You can use the native DirectX library in C++/CLI. In C++/CLI you can mix managed C++ und unmanaged C++. This means you can access the native library with unmanaged C++ in a managed function which can be used from any .net code. C++/CLI is a perfect solution for this native wrapper things.

    regards

    • Marked as answer by Mawero Friday, July 9, 2010 2:39 PM
    Friday, July 9, 2010 2:05 PM
  • Nice then... the problem i've found now is the following:

    I could convert directly all the C# code to C++/CLI with Instant C++ because all references will work except managed directX ones. Then i could easily resolve the references from the managed DirectX dll to the native DirectX dll but then... I won't have a C++/CLI to native C++ converter!! :D

    My problem is just a typing one. I can easily convert Interfaces, locks etc to C++ structures because i've programmed all my aplication structure having in mind it will be one day converted to native C++ (In fact emulating multiinheritance with Interfaces has been a weird programming sport). But... my app has over half million lines of code so it will be a pain in the ____ changing millions of symbols (i'm even thinking in making my own C++/CLI to native C++ (symbol) converter for the not .NET references)

    whatever...

    Friday, July 9, 2010 3:30 PM