Click here to Skip to main content
16,009,150 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Sending Email without using Outlook Pin
yogesh_kumar_agarwal17-Oct-07 10:34
yogesh_kumar_agarwal17-Oct-07 10:34 
GeneralRe: Sending Email without using Outlook Pin
svanwass18-Oct-07 9:04
svanwass18-Oct-07 9:04 
AnswerRe: Sending Email without using Outlook Pin
GuyThiebaut17-Oct-07 9:03
professionalGuyThiebaut17-Oct-07 9:03 
GeneralRe: Sending Email without using Outlook Pin
yogesh_kumar_agarwal17-Oct-07 10:35
yogesh_kumar_agarwal17-Oct-07 10:35 
GeneralRe: Sending Email without using Outlook Pin
GuyThiebaut17-Oct-07 23:03
professionalGuyThiebaut17-Oct-07 23:03 
AnswerRe: Sending Email without using Outlook Pin
Christian Graus17-Oct-07 10:56
protectorChristian Graus17-Oct-07 10:56 
QuestionCan we read return from a process without waiting its completion? Pin
ATC17-Oct-07 7:59
ATC17-Oct-07 7:59 
AnswerRe: Can we read return from a process without waiting its completion? Pin
Dave Kreskowiak17-Oct-07 15:26
mveDave Kreskowiak17-Oct-07 15:26 
ATC wrote:
Thread.Sleep(100)
s1 = sOut.ReadLine
ps1.Kill()


I love how you wait one tenth of a second, read a single line of it's output, and then kill the process, whether it's doing something or not. Then you continue and try and read lines from a process you already killed off. You cannot do that. The process object must stay running in order for you to read from it's output stream.


ATC wrote:
However, if the process does not stop then the ListBox can not update data


This is because the UI thread is running the code to read the output stream from the process. Until the read operation and filling of the ListBox is done and your code goes idle again, you're controls cannot repaint themselves because the thread is busy doing other things.

ATC wrote:
I think because the process takes more priority then the ListBox?)


Priority has nothing to do with it. Threading does.


ATC wrote:
1. Can we modify the above codes so that we can update the ListBox without waiting the process completed?


You cant read hasn't has been output, so no. You have to wait for the process to finish. If by this statement you mean that you want the control to repaint itself and continue to fill the ListBox with data, you either have to move the code that reads the output stream to another thread, or you have to read the output stream asynchronously.



A guide to posting questions on CodeProject[^]

Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


GeneralRe: Can we read return from a process without waiting its completion? Pin
ATC18-Oct-07 6:05
ATC18-Oct-07 6:05 
GeneralRe: Can we read return from a process without waiting its completion? Pin
svanwass18-Oct-07 9:09
svanwass18-Oct-07 9:09 
GeneralRe: Can we read return from a process without waiting its completion? Pin
Dave Kreskowiak18-Oct-07 12:09
mveDave Kreskowiak18-Oct-07 12:09 
AnswerRe: Can we read return from a process without waiting its completion? Pin
Luc Pattyn17-Oct-07 15:38
sitebuilderLuc Pattyn17-Oct-07 15:38 
GeneralRe: Can we read return from a process without waiting its completion? Pin
ATC18-Oct-07 6:06
ATC18-Oct-07 6:06 
QuestionPerforming drag and drop between two datagridviews? Pin
Mr Oizo17-Oct-07 7:19
Mr Oizo17-Oct-07 7:19 
AnswerRe: Performing drag and drop between two datagridviews? Pin
Dave Kreskowiak17-Oct-07 14:21
mveDave Kreskowiak17-Oct-07 14:21 
QuestionButton with menu in outlook Pin
Koltz17-Oct-07 6:56
Koltz17-Oct-07 6:56 
Questioncatch internet explorer web site request Pin
Jamal Encami17-Oct-07 5:33
professionalJamal Encami17-Oct-07 5:33 
AnswerRe: catch internet explorer web site request Pin
Colin Angus Mackay17-Oct-07 6:12
Colin Angus Mackay17-Oct-07 6:12 
GeneralRe: catch internet explorer web site request Pin
Dave Kreskowiak17-Oct-07 6:58
mveDave Kreskowiak17-Oct-07 6:58 
AnswerRe: catch internet explorer web site request Pin
Dave Kreskowiak17-Oct-07 6:12
mveDave Kreskowiak17-Oct-07 6:12 
AnswerRe: catch internet explorer web site request Pin
svanwass18-Oct-07 9:07
svanwass18-Oct-07 9:07 
AnswerRe: catch internet explorer web site request Pin
Jamal Encami18-Oct-07 13:10
professionalJamal Encami18-Oct-07 13:10 
Questionplease help Pin
Sonia Gupta17-Oct-07 4:25
Sonia Gupta17-Oct-07 4:25 
AnswerRe: please help Pin
Dave Kreskowiak17-Oct-07 5:15
mveDave Kreskowiak17-Oct-07 5:15 
GeneralRe: please help Pin
Colin Angus Mackay17-Oct-07 6:13
Colin Angus Mackay17-Oct-07 6:13 

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.