views:

59

answers:

3

Hello,

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!

+2  A: 

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
A: 

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

Chetan
A: 

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.

DeadMG