A
Andrius B.
Hi guys.
I have such a task.
I am developing a VB.NET app (as WindowsExe application, not console) to
work with Oracle DB.
To retrieve the data, I use such method: call PLUS80.EXE, witch takes db
username and password, connects to db, executes given SQL script and writes
data to CSV files.
PLUS80.EXE is a console app, I call it using SHELL command in vb.net:
Shell("PLUS80 " & User & "/" & Pass & " @export.sql", AppWinStyle.Hide,
True)
So, PLUS80 executes in a hidden window, in order to simplify the work with
my app (not to confuse user with pop-up windows). And the main app waits
till PLUS80 finishes.
If smth goes wrong, e.g. bad username or password is given, PLUS throws an
exception (like ORA-xxxxx: some text) and waits for user actions (e.g. enter
password manually). The problem is, that is such a case PLUS80 "freezes",
and the main app also freezes waiting for PLUS80 exiting. User can do
nothing, because it sees nothing - the PLUS80 window is hidden.
So, I'd like to have a tool to enable my main app to retrieve the text from
PLUS80 window (that means, the text from that console window that is
outputed). Then I'll be able to strip from all that text the line containing
string like "ORA-xxxxx", and show it to the user by using MsgBox.
And the second part, i need a tool to send some text to console (like "exit"
command, witch will end PLUS80, and my main app "unfreezes"), imitating
pressing the
keyboard keys ending with "Enter" key pressing.
I know how to retrieve the handle of console window using FindWindow API,
but that's all.
I heard there are functions smth like ReadConcoleText, but no egamples how
to use it from an VB.NET
The main app is designet to work on Windows 2000 and Windows XP.
Thanks for any idea.
I have such a task.
I am developing a VB.NET app (as WindowsExe application, not console) to
work with Oracle DB.
To retrieve the data, I use such method: call PLUS80.EXE, witch takes db
username and password, connects to db, executes given SQL script and writes
data to CSV files.
PLUS80.EXE is a console app, I call it using SHELL command in vb.net:
Shell("PLUS80 " & User & "/" & Pass & " @export.sql", AppWinStyle.Hide,
True)
So, PLUS80 executes in a hidden window, in order to simplify the work with
my app (not to confuse user with pop-up windows). And the main app waits
till PLUS80 finishes.
If smth goes wrong, e.g. bad username or password is given, PLUS throws an
exception (like ORA-xxxxx: some text) and waits for user actions (e.g. enter
password manually). The problem is, that is such a case PLUS80 "freezes",
and the main app also freezes waiting for PLUS80 exiting. User can do
nothing, because it sees nothing - the PLUS80 window is hidden.
So, I'd like to have a tool to enable my main app to retrieve the text from
PLUS80 window (that means, the text from that console window that is
outputed). Then I'll be able to strip from all that text the line containing
string like "ORA-xxxxx", and show it to the user by using MsgBox.
And the second part, i need a tool to send some text to console (like "exit"
command, witch will end PLUS80, and my main app "unfreezes"), imitating
pressing the
keyboard keys ending with "Enter" key pressing.
I know how to retrieve the handle of console window using FindWindow API,
but that's all.
I heard there are functions smth like ReadConcoleText, but no egamples how
to use it from an VB.NET
The main app is designet to work on Windows 2000 and Windows XP.
Thanks for any idea.