2

I'm looking to programmatically generate unmanaged C++ code via CodeDom. It seems that the default implementation of CppCodeProvider is only capable of generating managed C++/CLI.

Any alternatives out there?

Thanks!

Igal Tabachnik
  • 31,174
  • 15
  • 92
  • 157
  • 1
    Why do you want to use CodeDOM? Do you have working code to generate C# and want to reuse it? Or is that just the first code generation technique you heard about? – Ben Voigt Jul 20 '10 at 20:28

3 Answers3

2

That's not going to fly. There's a rather serious impedance mismatch between the classes in the System.CodeDom, like CodeStatement et al, and the structure of a native C++ program. There's no way to model something as basic as a non-class member function, not supported in managed code. Or the notion of #including header files. Or single-pass compilation. Etcetera.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
0

Take a look at tools from OSSNokalva. They have some interesting tools for code generation from XSD. http://www.oss.com/

Chetan
  • 184
  • 12
0

As far as I know, there's no way of building native C++ built in to .NET. I've been looking for a long time. Even if you build a Visual Studio Extension, you can't generate it in the same way that you can just have string[] sources for the C# compiler.

Puppy
  • 144,682
  • 38
  • 256
  • 465