473,698 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with me.invoke MethodeInvoker

Hello

I'm new to VB.Net and try to create a console applicatione which will
redirect the output to an arraylist.

I found a very good sample at:
http://dotnet.mvps.org/dotnet/sample...ectConsole.zip

Basically it works. But the problem is I'm unsure about the invoke. The
results will only be added (AddTextToArray ) if the application is
finished with all procedures. This seems to be the synchronus call from
the invoke. I need to make multiple calls to the console and need the
results from the first call. How wil I know when the program is finished
and how can I triger the other calls to the console.

Private Sub StreamOutput()
Dim Line As String = m_Process.Stand ardOutput.ReadL ine()
Try
Do While Line.Length >= 0
If Line.Length 0 Then
AddText(Convert FromOem(Line))
End If
Line = m_Process.Stand ardOutput.ReadL ine()
Loop
Catch
Debug.Print(Str ing.Format("""{ 0}"" wurde beendet!",
m_Process.Start Info.FileName))
End Try
End Sub
Private Sub AddText(ByVal Text As String)
m_TextToAdd = Text
Me.Invoke(CType (AddressOf Me.AddTextToArr ay, MethodInvoker))
End Sub
Private Sub AddTextToArray( )
If ConsoleInitiali zed Then
ConsoleResults. Add(m_TextToAdd )
End If
End Sub
Please be aware I'm very new to VB.Net.....
appreciating any help

Regards

Manfred
Dec 3 '06 #1
0 1995

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

Similar topics

2
1327
by: bisquic | last post by:
Ok, I've read a handful of articles out there concerning the issue of accessing a control from a thread other than the one from which it was created. I think the most well-rounded solution I found is to create a delegate to a function that accesses the control and then call this->Invoke( theDelegate ) from the worker thread in the form to marshal the call to the UI thread. I wrote a test app to try this out and the problem I'm having is...
14
2930
by: Christian Kaiser | last post by:
We have a component that has no window. Well, no window in managed code - it uses a DLL which itself uses a window, and this is our problem! When the garbage collector runs and removes our component (created dynamically by, say, a button click, and then not referenced any more), the GC runs in a different thread, which prohibits the DLL to destroy its window, resulting in a GPF when the WndProc of that window is called - the code is gone...
8
13613
by: jesmi | last post by:
my code is: addRecord.cfm <cfinclude template="head.cfm"> <p> <table width="100%" border="0" align="center" cellpadding="2" cellspacing="0"> <tr> <td> <div align="center">
7
1377
by: Jeroen | last post by:
We converted our decently large (13 projects, compiled about 12 mb) VStudio 2003/.Net1.1 project to VStudio 2005/.Net2. My two colleagues have no problem starting the new solution, but I get an exception thrown at me. I only get the exception if I run in debug mode, in release mode all works fine. The exception thrown somewhere along startup sequence is: The following snippet shows where the exception is thrown:
3
6512
by: mayur1 | last post by:
Hello everybody, I am trying to connect to DB2 V 8.1 on Red Hat Linux V5 from WebSphere Application Server V6 on Windows Server 2003. The problem that i am facing is that its not able to opent the socket on the port to communicate with the was and the db2. here is the error i get: 00000043 ResourceMgrIm I WSVR0049I: Liaison de DefaultEJBTimerDataSource en tant que jdbc/DefaultEJBTimerDataSource 00000043 ResourceMgrIm I WSVR0049I:...
1
2149
by: rohitkec | last post by:
I am new to both java andb apache tomcat.i am presently using apache tomcat 4.1.31 & j2re-1_4_2_10.when i am running http://127.0.0.1:8080/admin/login.jsp or admin file i am getting the following errors: org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: -1 in the jsp file: null Generated servlet error: Compiling 1 source file
0
3410
rsrinivasan
by: rsrinivasan | last post by:
Hi All, When i run my JSP program, ihave the following exception. How i solve this problem? HTTP Status 500 - -------------------------------------------------------------------------------- type Exception report message
1
2144
by: sethupnr | last post by:
when i'm using a simple JSP-mysql code it shows some HTTP status 500 error.But simple JSP program without databse is running , Please help how to solve this problem. I'm new to JSP. my configurations are... i installed j2sdk in C:\j2sdk1.4.2_16 then installed jakarte-tomcat in C:\Program Files\Apache Tomcat 4.0 folder copied mysql-connector-java-3.0.17-ga-bin.jar to C:\Program Files\Apache Tomcat 4.0\common\lib
3
1452
by: ajithraj | last post by:
haiii pls help me to solve this.. whenever i tried to login,it shows an error msg: Compile failed; see the compiler error output for details. at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:842) at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:682) at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:317)
0
8674
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9027
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7725
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4369
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2329
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.