System.Diagnostics.ProcessStartInfo

Help: MIssing references or assembly??

Page 1 of 1

8 Replies - 4674 Views - Last Post: 02 July 2010 - 07:45 AM Rate Topic: -----

#1 Guest_Zealord*


Reputation:

System.Diagnostics.ProcessStartInfo

Posted 30 June 2010 - 06:51 PM

My code below has some issues in visual studio, this project is build under C# -> Windows Ce 5.0 -> smart device -> Device application. The problem i'm experiencing is that those RED colored words are giving me error like: "'System.Diagnostics.ProcessStartInfo' does not contain a definition for 'RedirectStandardOutput' and no extension method 'RedirectStandardOutput' accepting a first argument of type 'System.Diagnostics.ProcessStartInfo' could be found (are you missing a using directive or an assembly reference?)" and therefore, cannot be compiled. Can you guys help me? Thank You!
===========================================================================

using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;

//using System.IO.StreamReader;
//using System.IO;

namespace Reading
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            System.Diagnostics.Process p = new System.Diagnostics.Process();

            p.StartInfo.FileName = "TestApp.exe";
            p.StartInfo.Arguments = "";
            p.StartInfo.[color="#FF0000"]RedirectStandardOutput [/color]= true;
            p.StartInfo.[color="#FF0000"]RedirectStandardInput [/color]= true;
            p.StartInfo.UseShellExecute = false;
            p.StartInfo.[color="#FF0000"]CreateNoWindow [/color]= true;

            p.[color="#FF0000"]OutputDataReceived [/color]+= new System.Diagnostics.[color="#FF0000"]DataReceivedEventHandler[/color](ConsoleOutputHandler);

            p.Start();
            p.[color="#FF0000"]BeginOutputReadLine[/color]();


        }
    }
}

This post has been edited by JackOfAllTrades: 30 June 2010 - 06:57 PM
Reason for edit:: Added code tags.


Is This A Good Question/Topic? 0

Replies To: System.Diagnostics.ProcessStartInfo

#2 Momerath  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1012
  • View blog
  • Posts: 2,444
  • Joined: 04-October 09

Re: System.Diagnostics.ProcessStartInfo

Posted 30 June 2010 - 10:53 PM

I suspect that the CE version of .NET doesn't have those features, as you probably don't have a console window in CE.
Was This Post Helpful? 0
  • +
  • -

#3 Guest_Zealord*


Reputation:

Re: System.Diagnostics.ProcessStartInfo

Posted 30 June 2010 - 10:59 PM

View PostMomerath, on 30 June 2010 - 09:53 PM, said:

I suspect that the CE version of .NET doesn't have those features, as you probably don't have a console window in CE.


Ya i just found out that. Thank you for telling me though. Anyway is there any way to use a dll to call a function or method from a c program?
Was This Post Helpful? 0

#4 Momerath  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1012
  • View blog
  • Posts: 2,444
  • Joined: 04-October 09

Re: System.Diagnostics.ProcessStartInfo

Posted 01 July 2010 - 05:58 AM

I'm guessing you mean "can you call a C/C++ DLL from C#?" If so, yes there is. It's called P/Invoke and you can read about it on MSDN or pinvoke.net

This post has been edited by Momerath: 01 July 2010 - 05:59 AM

Was This Post Helpful? 1
  • +
  • -

#5 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6111
  • View blog
  • Posts: 23,672
  • Joined: 23-August 08

Re: System.Diagnostics.ProcessStartInfo

Posted 01 July 2010 - 07:48 AM

Same poster
Was This Post Helpful? 0
  • +
  • -

#6 Guest_Zealord*


Reputation:

Re: System.Diagnostics.ProcessStartInfo

Posted 01 July 2010 - 06:59 PM

View PostMomerath, on 01 July 2010 - 04:58 AM, said:

I'm guessing you mean "can you call a C/C++ DLL from C#?" If so, yes there is. It's called P/Invoke and you can read about it on MSDN or pinvoke.net



Actually i'm trying to use the dll to call a method in the c program to return a value for my c# program.

The flow is like this, c# program calls DLL, DLL calls method in c to return a value for my c# program. Is it even possible?
Was This Post Helpful? 0

#7 Momerath  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1012
  • View blog
  • Posts: 2,444
  • Joined: 04-October 09

Re: System.Diagnostics.ProcessStartInfo

Posted 01 July 2010 - 10:42 PM

View PostZealord, on 01 July 2010 - 04:59 PM, said:

The flow is like this, c# program calls DLL, DLL calls method in c to return a value for my c# program. Is it even possible?
Yep, same links as before.
Was This Post Helpful? 0
  • +
  • -

#8 Guest_White*


Reputation:

Re: System.Diagnostics.ProcessStartInfo

Posted 02 July 2010 - 12:09 AM

But i don't really understand it. Is there any simpler version?
Was This Post Helpful? 0

#9 Momerath  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1012
  • View blog
  • Posts: 2,444
  • Joined: 04-October 09

Re: System.Diagnostics.ProcessStartInfo

Posted 02 July 2010 - 07:45 AM

Not really. If you give the C method you are trying to call, we can probably figure out the P/Invoke syntax you'll need to call it. I do have to ask why you need to call a DLL to call a DLL though, why not just call the 2nd DLL directly?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1