You are not logged in.

  • Login

Dear visitor, welcome to Coder Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Thursday, April 2nd 2009, 1:29pm

Falscher rückgabetyp... OutputDataReceived + DataReceivedEventHandler

hallo zusammen,

ich sehe wohl gerade voll auf der leitung...

kann mir bitte jemand mit dieser compilermeldung weiter helfen? :

"System.Collections.ArrayList Subversion.GetQView.pro_OutputDataReceived(object, System.Diagnostics.DataReceivedEventArgs)" hat den falschen Rückgabetyp.

der fehler tritt immer hier auf:

C# Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
try
            {
                Process pro = new Process();
                pro.OutputDataReceived += new DataReceivedEventHandler(pro_OutputDataReceived);
 
                ProcessStartInfo psi = new ProcessStartInfo(@"C:\WINNT\system32\cmd.exe");
                psi.UseShellExecute = false;
                psi.RedirectStandardOutput = true;
                psi.RedirectStandardError = true;
                psi.RedirectStandardInput = true;
                psi.CreateNoWindow = true;
                psi.Arguments = "/c \"" + sPathSvn + " " + sList + " " + sProject + " \"";
 
                if (psi.Arguments.ToString() != "")
                {
                    pro.StartInfo = psi;
                    pro.Start();
                    pro.BeginOutputReadLine();
                }
            }


würde mich freun wenn mir jemand weiter helfen könnte.


thx, truespin

2

Thursday, April 2nd 2009, 2:36pm

Auch wenn es vmtl. nicht zum Ziel führt, was heißt das "@" in Zeile 6?

Ansonsten schmeiß mal den debuger an und guck an welcher Stelle er denn genau abhaut.

3

Thursday, April 2nd 2009, 6:41pm

also die Variable pro_OutputDataReceived muss vom Typ System.Diagnostics.DataReceivedEventArgs sein. Siehe dazu http://msdn.microsoft.com/en-us/library/…enthandler.aspx
Welchen Typ hat sie denn?

4

Thursday, April 2nd 2009, 8:09pm

hallo,

zu fokus:
verwendet man vor einem pfad das @ zeichen müssen nicht wie sonst zwei \\ eingegeben werden. ohne dem @ müsste man in einem pfad anstatt einem \ zwei \\ eingeben, da nur der zweite dargestellt wird.

zu donut:
das werde ich mir morgen gleich ansehen... könnte natürlich sein das ich da was vermasselt hab, ist aber wohl unwarscheinlicher ;)

vielen dank erstamal. ich werde dann mein ergebnis wieder hier rein posten.


thx, truespin

5

Friday, April 3rd 2009, 9:10am

hallo,

ich habe jetzt meinen fehler gefunden aber nicht wirklich verstanden...
kann jemand meinen beschränkten c# kenntnissen auf die sprünge helfen?

C# Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
public void getQview(String sList, String sPathSvn, String sProject)
        { 
            this.sList = sList;
            this.sPathSvn = sPathSvn;
            this.sProject = sProject;
 
            try
            {
                Process pro = new Process();
                pro.OutputDataReceived += new DataReceivedEventHandler(pro_OutputDataReceived);
 
                ProcessStartInfo psi = new ProcessStartInfo(@"C:\WINNT\system32\cmd.exe");
                psi.UseShellExecute = false;
                psi.RedirectStandardOutput = true;
                psi.RedirectStandardError = true;
                psi.RedirectStandardInput = true;
                psi.CreateNoWindow = true;
                psi.Arguments = "/c \"" + sPathSvn + " " + sList + " " + sProject + " \"";
 
                if (psi.Arguments.ToString() != "")
                {
                    pro.StartInfo = psi;
                    pro.Start();
                    pro.BeginOutputReadLine();
                }
            }
            catch (Exception o)
            {
                MessageBox.Show(o.Message + o.Source + o.InnerException);
            }
        }




C# Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
void pro_OutputDataReceived(object sender, DataReceivedEventArgs e)
        {
            qView.Clear();
 
            try
            { 
                if(e.Data  != null && e.Data != "")
                {
                    this.qView.Add(e.Data.ToString());      
                }
            }
            catch(Exception o)
            {
                MessageBox.Show(o.Message + o.Source + o.StackTrace, "Fehle", MessageBoxButtons.OK, MessageBoxIcon.Error);   
            }
 
            //return this.qView;
        }


im zweiten codeauszug hatte ich im methodenkopf statt

C# Quellcode

1
void pro_OutputDataReceived(object sender, DataReceivedEventArgs e)
das hier stehen:

C# Quellcode

1
private ArrayList pro_OutputDataReceived(object sender, DataReceivedEventArgs e)
und dementsprechend auch als return eine arraylist zurück gegeben...


thx, truespin

Similar threads

Social bookmarks