Click here to Skip to main content
15,917,642 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralTo get focus on textbox Pin
sumit703423-Jan-08 18:07
sumit703423-Jan-08 18:07 
GeneralRe: To get focus on textbox Pin
Paul Conrad23-Jan-08 18:13
professionalPaul Conrad23-Jan-08 18:13 
GeneralRe: To get focus on textbox Pin
sumit703423-Jan-08 18:24
sumit703423-Jan-08 18:24 
GeneralRe: To get focus on textbox Pin
Paul Conrad23-Jan-08 18:42
professionalPaul Conrad23-Jan-08 18:42 
GeneralRe: To get focus on textbox Pin
sumit703423-Jan-08 18:57
sumit703423-Jan-08 18:57 
GeneralRe: To get focus on textbox Pin
Vimalsoft(Pty) Ltd24-Jan-08 1:57
professionalVimalsoft(Pty) Ltd24-Jan-08 1:57 
GeneralRe: To get focus on textbox Pin
Johan Hakkesteegt25-Jan-08 2:35
Johan Hakkesteegt25-Jan-08 2:35 
GeneralCapturing stdout and stderr when running a subcommand (WSH) Pin
orev23-Jan-08 11:52
orev23-Jan-08 11:52 
Hi all,

Background: I have some tools provided by a vendor that I need to write a wrapper script around. The wrapper script has to check a few things, then call those command line tools. I am seeing a problem when the commands output a large amount of text, the script seems to get "stuck".

I think it's a result of the buffer filling up and then the command gets suspended. I am polling stdout and copying anything on it to my own stdout, but it seems that large amounts of output still cause it to freeze up.

Here is the relevant code:
<br />
Dim MyCommand<br />
MyCommand = "%comspec% /c " & CommandLine & " 2>&1"<br />
<br />
' Run the command<br />
Dim objShell, objExec<br />
Set objShell = CreateObject("WScript.Shell")<br />
Set objExec = objShell.Exec(MyCommand)<br />
<br />
' Output stdout from command<br />
Do Until objExec.StdOut.AtEndOfStream<br />
	If Not objExec.StdOut.AtEndOfStream Then<br />
		WScript.StdOut.WriteLine objExec.StdOut.ReadLine<br />
	End If<br />
Loop<br />
<br />
' Wait for the command to finish<br />
Do While objExec.Status = 0<br />
	WScript.Sleep 100<br />
Loop


The ideal situation is if I could call the subcommands and allow their stdout/stderr to flow to the correct place in my script's output buffers, but so far I have not found a way to do this. The next best thing would be if this polling would actually work all the time, and keep the correct order of the output. The worst solution would be to save the output to a file, then output it myself later.
Generalthree level datagrid drill down Pin
uglyeyes23-Jan-08 10:59
uglyeyes23-Jan-08 10:59 
QuestionPossible to know when copy or paste is done? Pin
abbabbabba23-Jan-08 7:02
abbabbabba23-Jan-08 7:02 
Generalcommunication state Pin
Agbaria Ahmad23-Jan-08 6:31
Agbaria Ahmad23-Jan-08 6:31 
QuestionRichTextBox find and replace Pin
Steven J Jowett23-Jan-08 6:12
Steven J Jowett23-Jan-08 6:12 
AnswerRe: RichTextBox find and replace Pin
Steven J Jowett24-Jan-08 1:57
Steven J Jowett24-Jan-08 1:57 
GeneralConnecting to remote data Pin
dptalt23-Jan-08 5:35
dptalt23-Jan-08 5:35 
GeneralRe: Connecting to remote data Pin
Justin Perez23-Jan-08 5:45
Justin Perez23-Jan-08 5:45 
Questionsetup wizard Pin
Agbaria Ahmad23-Jan-08 3:25
Agbaria Ahmad23-Jan-08 3:25 
AnswerRe: setup wizard Pin
Muhammad Shahid Farooq23-Jan-08 6:04
professionalMuhammad Shahid Farooq23-Jan-08 6:04 
GeneralListbox LostFocus event Pin
manisghouri23-Jan-08 1:54
manisghouri23-Jan-08 1:54 
GeneralRe: Listbox LostFocus event Pin
C1AllenS23-Jan-08 18:15
C1AllenS23-Jan-08 18:15 
GeneralRe: Listbox LostFocus event Pin
manisghouri24-Jan-08 2:45
manisghouri24-Jan-08 2:45 
GeneralUnspecified Error in OleDB.oleDbConnection Pin
SekharOne23-Jan-08 1:23
SekharOne23-Jan-08 1:23 
GeneralRe: Unspecified Error in OleDB.oleDbConnection Pin
Kschuler23-Jan-08 5:37
Kschuler23-Jan-08 5:37 
GeneralRe: Unspecified Error in OleDB.oleDbConnection Pin
SekharOne23-Jan-08 17:29
SekharOne23-Jan-08 17:29 
GeneralRe: Unspecified Error in OleDB.oleDbConnection Pin
Kschuler24-Jan-08 3:20
Kschuler24-Jan-08 3:20 
GeneralZoomIn and ZoomOut a panel [modified] Pin
Rupesh Kumar Swami22-Jan-08 23:57
Rupesh Kumar Swami22-Jan-08 23:57 

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.