Click here to Skip to main content
16,004,901 members
Home / Discussions / C#
   

C#

 
GeneralRe: Asking for help drawing lines with the mouse [modified] Pin
ghost_uwi116-Feb-07 5:17
ghost_uwi116-Feb-07 5:17 
QuestionMicrosoft Chart control 6.0-Row Data Pin
GunaChinna15-Feb-07 18:55
GunaChinna15-Feb-07 18:55 
QuestionIfilter.. Pin
Member 382304615-Feb-07 18:25
Member 382304615-Feb-07 18:25 
QuestionInvoking the VS C++ compiler from a C# application Pin
hain15-Feb-07 13:11
hain15-Feb-07 13:11 
AnswerRe: Invoking the VS C++ compiler from a C# application Pin
ShermansLagoon16-Feb-07 1:01
ShermansLagoon16-Feb-07 1:01 
GeneralRe: Invoking the VS C++ compiler from a C# application Pin
hain16-Feb-07 3:48
hain16-Feb-07 3:48 
GeneralRe: Invoking the VS C++ compiler from a C# application Pin
ShermansLagoon17-Feb-07 21:08
ShermansLagoon17-Feb-07 21:08 
GeneralRe: Invoking the VS C++ compiler from a C# application Pin
hain18-Feb-07 8:35
hain18-Feb-07 8:35 
Well, yes and no, but certainly thanks for setting me on the right path. With some experimentation I came up with a successful C# handler (based on your code, but with necessary environment variables set--and with directories hard coded for my computer) for a "compile and run" button as follows:

////////////////////////////
protected void CompileAndRun_Click(object sender, EventArgs e)
{
// Set up environment
Environment.SetEnvironmentVariable("INCLUDE", @"C:\Program Files\Microsoft Visual Studio 8\VC\ATLMFC\INCLUDE;C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE;C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include;C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\include;");
Environment.SetEnvironmentVariable("LIB", @"C:\Program Files\Microsoft Visual Studio 8\VC\ATLMFC\LIB;C:\Program Files\Microsoft Visual Studio 8\VC\LIB;C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib;C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\lib");
Environment.SetEnvironmentVariable("LIBPATH", @"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;C:\Program Files\Microsoft Visual Studio 8\VC\ATLMFC\LIB");
Environment.SetEnvironmentVariable("Path", @"%Path%;C:\Program Files\Microsoft Visual Studio 8\Common7\IDE;C:\Program Files\Microsoft Visual Studio 8\VC\BIN");

// Compile program
ProcessStartInfo psi = new ProcessStartInfo("cl.exe", @" -Fec:\testCompile\hello.exe -EHsc c:\testCompile\hello.cpp");
psi.CreateNoWindow = true;
psi.RedirectStandardError = true;
psi.RedirectStandardOutput = true;
psi.UseShellExecute = false;
Process p = new Process();
p.StartInfo = psi;
p.Start();
p.WaitForExit();
compilerMessages.Text = p.StandardOutput.ReadToEnd(); ;

//Execute program
ProcessStartInfo psi2 = new ProcessStartInfo(@"c:\testCompile\hello.exe");
psi2.CreateNoWindow = true;
psi2.RedirectStandardError = true;
psi2.RedirectStandardOutput = true;
psi2.UseShellExecute = false;
Process p2 = new Process();
p2.StartInfo = psi2;
p2.Start();
p2.WaitForExit();
programOutput.Text = p2.StandardOutput.ReadToEnd();
}
/////////////

Again, thanks!
Tom
GeneralRe: Invoking the VS C++ compiler from a C# application Pin
ShermansLagoon18-Feb-07 19:17
ShermansLagoon18-Feb-07 19:17 
QuestionDataset Looping Pin
#realJSOP15-Feb-07 10:47
professional#realJSOP15-Feb-07 10:47 
AnswerRe: Dataset Looping Pin
Ed.Poore16-Feb-07 1:07
Ed.Poore16-Feb-07 1:07 
GeneralRe: Dataset Looping Pin
#realJSOP16-Feb-07 2:02
professional#realJSOP16-Feb-07 2:02 
GeneralRe: Dataset Looping Pin
Ed.Poore16-Feb-07 2:10
Ed.Poore16-Feb-07 2:10 
GeneralRe: Dataset Looping Pin
kubben16-Feb-07 2:12
kubben16-Feb-07 2:12 
AnswerRe: Dataset Looping Pin
Chris Buckett16-Feb-07 1:15
Chris Buckett16-Feb-07 1:15 
GeneralRe: Dataset Looping Pin
#realJSOP16-Feb-07 2:00
professional#realJSOP16-Feb-07 2:00 
GeneralRe: Dataset Looping Pin
Chris Buckett16-Feb-07 2:04
Chris Buckett16-Feb-07 2:04 
GeneralRe: Dataset Looping Pin
Chris Buckett16-Feb-07 2:19
Chris Buckett16-Feb-07 2:19 
GeneralRe: Dataset Looping Pin
Todd Smith16-Feb-07 7:42
Todd Smith16-Feb-07 7:42 
AnswerRe: Dataset Looping Pin
megaadam16-Feb-07 2:20
professionalmegaadam16-Feb-07 2:20 
AnswerRe: Dataset Looping Pin
Jon Sagara16-Feb-07 3:46
Jon Sagara16-Feb-07 3:46 
GeneralRe: Dataset Looping Pin
#realJSOP16-Feb-07 4:11
professional#realJSOP16-Feb-07 4:11 
QuestionSome issues in strong naming .net dlls Pin
f4hd15-Feb-07 9:48
f4hd15-Feb-07 9:48 
AnswerRe: Some issues in strong naming .net dlls Pin
Luc Pattyn15-Feb-07 15:20
sitebuilderLuc Pattyn15-Feb-07 15:20 
GeneralRe: Some issues in strong naming .net dlls Pin
f4hd16-Feb-07 8:03
f4hd16-Feb-07 8:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.