Reputation:

How to write a vb.net code to compile and execute C programs?

I'm trying to make a vb.net application that has got 2 textboxes, 2 radio buttons and 2 buttons(one named compile and the other 'run'). How can I load the content of a C/C++ file into the 1st textbox and on clicking the compile button, i should be able to show the errors or the C/C++ program in the 2nd textbox. On clicking Run, I should be able to show the output in the 2nd textbox. In short, I want to use the 2nd textbox as a terminal/console. The radio buttons are 4 selecting the language C or C++.

Upvotes: 0

Views: 1906

Answers (3)

Gary.Ray
Gary.Ray

Reputation: 6501

Look at this article - good examples on calling external programs (which is what your c++ compiler would be unless you intend to write your own) from VB.Net.

Upvotes: 1

Motti
Motti

Reputation: 114725

I don't think writing a C++ compiler in VB.NET is something an absolute beginner should be undertaking. Writing a compiler is a very advanced field.

Upvotes: 0

Eoin Campbell
Eoin Campbell

Reputation: 44278

Why would you want to? What are you trying to do. Do you just want to execute the commandline compilers from a VB.NET Application ?

If so have a look at the System.Diagnostics.Process.Start() method which allows you to execute another application.

Upvotes: 0

Related Questions