473,396 Members | 1,998 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Is there not a C++ compiler for CodeDOM?

Using the CodeDomExample

http://msdn.microsoft.com/library/de...classtopic.asp

I added support for C++. The example will generate the C++ code
listing using the MCppCodeProvider OK, but when it comes to the
statement:

ICodeCompiler compiler = provider.CreateCompiler();

it returns null and so it can't compile the C++ listing.

Is there not a C++ compiler for Codedom?

Here are my additions to the CodedomExample which fail me.
namespace CodeDOMExample
{

using Microsoft.MCpp;
// ADDED namespace

public CodeDomExampleForm()
{
....
this.comboBox1.Items.AddRange( new string[] { "CSharp",
"Visual Basic", "JScript", "C++" } ); // ADDED "C++" item
....
}

private CodeDomProvider GetCurrentProvider()
{
...
case "C++": provider = new MCppCodeProvider();
// ADDED MCppCodeProvider to case statement
break;
...
}
return provider;
}

public static CompilerResults CompileCode( CodeDomProvider
provider, String sourceFile, String exeFile )
{
ICodeCompiler compiler = provider.CreateCompiler();
// PROBLEM, returns null for CreateCompiler() when provider == new
MCppCodeProvider();
String [] referenceAssemblies = {"System.dll"};
CompilerParameters cp =
new CompilerParameters(referenceAssemblies, exeFile,
false);
cp.GenerateExecutable = true;
CompilerResults cr = compiler.CompileAssemblyFromFile
(cp, sourceFile); // ERROR, compiler ==
null
return cr;
}

}
Nov 17 '05 #1
0 1190

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Guillaume | last post by:
I don't think I'm the only one with this challenge so… I made code with the CodeDom classes and made code to create a new solution and a new project Now I want to get the codedom code in the new...
5
by: fayyaz | last post by:
I need to install C# compiler, could you please help me the steps? I got .net framework installed, because I have been learing ASP.NET on my own.What else needed to be installed, could you send...
3
by: Alexey Lavnikov | last post by:
I'm playing with CodeDOM and CSharpCodeProvider. I've found the following possibilities: CodeDOM -> Assembly C# Source code -> Assembly I miss the C# Source code -> CodeDOM only. Is it there?...
2
by: mudge | last post by:
Hi, I'm getting some very strange problems with some C# code. We're running an ASP.NET application on a local server in a DMZ. If I access it using the internal address, the application works...
9
by: lee.chappers | last post by:
How can I make the CodeDom generate the following C# method? protected sealed override void Test() { } I've tried using: domMethod.Attributes = MemberAttributes.Override |...
6
by: moondaddy | last post by:
will CodeDom create XAML windows or just regular windows forms? If so, how to I tell it to create a xaml window instead of a windows form? thanks -- moondaddy@noemail.noemail
2
by: CodeMonkey775 | last post by:
I'm having problems passing a variable to a method which is executed and compiled using CodeDom. The situation is I have a List<CellData> with cells, each containing a formula (like Excel). I am...
2
by: =?Utf-8?B?TUNN?= | last post by:
I am using the compiler: Microsoft.VisualBasic.VBCodeProvider What are the different options I can specify using <providerOption>? So far I have: <system.codedom> <compilers> <compiler...
2
by: meskeleton | last post by:
Hello everyone... I am new to this community so m sorry if this is not the place for this post... I uploaded my site (built in 3.5 framework) to the server which does not have 3.5 but 2.0. I...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.