|
Hi;
There is a better way to redirect the output of a DOS program which I cam across in my readings. And that is using the Process object. Here is what I did to test it.
Imports System.ComponentModel
Private ERROR_FILE_NOT_FOUND As Integer = 2
Private ERROR_ACCESS_DENIED As Integer = 5
Dim myProcess As Process = New Process
Try
Dim prgOutput As String ‘ Output from DOS program
Dim strSplit() As String = Nothing
Dim delimStr As String = Chr(13) & Chr(10)
Dim delimiter() As Char = delimStr.ToCharArray()
myProcess.StartInfo.FileName = tbPath.Text ‘Full pathname to including file name
myProcess.StartInfo.Arguments = tbOptions.Text ‘ If the program takes args as string
myProcess.StartInfo.CreateNoWindow = True ‘ Does not create a window DOS program
myProcess.StartInfo.UseShellExecute = False ‘ Must be false to redirect output
myProcess.StartInfo.RedirectStandardOutput = True
myProcess.Start() ‘ Start the DOS program
myProcess.WaitForExit() ‘ Wait until it completes before moving on
prgOutput = myProcess.StandardOutput.ReadToEnd ‘ Get the DOS output
prgOutput = prgOutput.Replace(delimiter, "|")
strSplit = prgOutput.Split("|"c)
For i As Integer = 0 To (strSplit.Length - 1)
lbOutput.Items.Add(strSplit(i))
Next
Catch ex As Win32Exception
If ex.NativeErrorCode = ERROR_FILE_NOT_FOUND Then
Console.WriteLine((ex.Message + ". Check the path."))
Else
If ex.NativeErrorCode = ERROR_ACCESS_DENIED Then
' Note that if your word processor might generate exceptions
' such as this, which are handled first.
Console.WriteLine((ex.Message + ". You do not have permission to print this file."))
End If
End If
End Try
|
|
|
|
|
Visual studio no longer breaks inte the debugger when an unhandled exception is thrown.
I've been using Visual Studio 2003 for a while now and everything have been working fint until recently. I probably have changed som settings that I now can't find.
I can trap the error by wrapping the line with Try, Catch or setting the Setting: Debug/Exceptions/CLR Exceptions to break into the debugger when the exception is thrown, but don't give me the same error message.
What do I have to do to make it work as it should again? This is making me crazy. The application just keeps going when it encounters an exception.
/Johan Trenkle
|
|
|
|
|
In the Menu goto Debugging - Exceptions
In the Exceptions Dlg expand Common Language Runtime Exceptions and check the System Entry
Stefan
|
|
|
|
|
I've gone through all settings in the CLR Exceptions and set them to Use Parent setting.
The top node (CLR Exceptions) is set to
When the exception is thrown: continue
If the exception is not handled: Break into the debugger
And that last thing is what I expect it to do, but it don't. It just jumps out of all functions it has entered and keeps on running without telling me anything.
Any ideas?
/JT
|
|
|
|
|
It sounds like your problem is that you've set the options to When Exception is Thrown: Continue. And that is exactly what it is doing. You've only set it to break into the debugger for unhandled exceptions. Your previous post indicated that you were including a handler. Try setting it to:
When the exception is thrown: Break into the debugger
Robert
|
|
|
|
|
How can i run a project from network. I have configured the security permission by giving the local intranet fulltrust in the machine node in the runtime security policy node. But it still is not working. It's urgent.
|
|
|
|
|
hi hello... can anyone help me how to use the AT Command??? i already opened port and im wondering how to send an at command... at command for sms messaging...?
|
|
|
|
|
Hello all,
I have one problem with combobox.the combobox is filled from datatable
displaymeber = empName
ValueMember =empId this is a lookup table
I have got record from another table and filled to dataview and i have not bind with controls,just i have give that directly like this
me.combobox.SelctedValue = me.Dataview.item(0).item(2)
when i have not any data(means nothing) in me.Dataview.item(0).item(2) ,it displays empty in combo text area,then the user edits the combobox,means change the selected text and he doesn't want to save the data,if he clicks i reload from dataview(refresh the old data).so it should be come epty in text area.but first time it displays first empname(means selectedindex goes to 0).then i click agai it will show empty record.how can i rectofy this
|
|
|
|
|
<br />
if me.dataview.item(0).item(1) is nothing then<br />
me.combobox.selectedvalue=nothing<br />
me.combobox.selectedText=nothing<br />
me.combobox.selectedIndex=-1<br />
<br />
me.combobox.text=nothing<br />
else<br />
me.combobox.selectedvalue=me.dataview.item(0).item(1)<br />
end if<br />
<br />
<br />
<br />
|
|
|
|
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformscomboboxobjectcollectionclasscleartopic.asp
|
|
|
|
|
hello
That is clear for all itms in combobox or listbox that site contents,i asked clear combobox text only
|
|
|
|
|
Hi,
Im populating a datagrid using threads which works fine.
Sometimes, though the datagrid gets distorted with double scrollbars. When I click on the scrollbar or maximise the window(to repaint it), I get any or both of the following:
exceptions
Two exceptions:
1. System.Runtime.InteropServices.SEHException' occurred in system.windows.forms.dll
Additional information: External component has thrown an exception.
2.An unhandled exception of type 'System.NullReferenceException' occurred in Unknown Module.
Additional information: Object reference not set to an instance of an object.
Note: I have already used the form.beginInvokeMethod which allows a datagrid to be populated using threads.This works fine. So plz give some other solution.
Any solutions?
|
|
|
|
|
Well, it looks like you've already done the obvious stuff. So, without seeing your code, it's impossible to tell what's going wrong and why.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
Oracle Ver. 8.1.7
Client : ODP.Net ver 9.2.4
App. using VB.net
I have an application for our sales people, where our sales people prepare Client Visit Reports in MS Word (.Doc). At present they are entering the visit details into my application, now they want this report prepared in Word document also to be stored into the database and will be removed from their local drives. Anybody shld access the Report doc only thru this application.
I need to achieve the following :
1. User shld be able to upload a word file to the DB from a mapped drive.
2. Once loaded user shld be able to open the word file stored in the DB, thru the application and edit it and save it again.
Can we achieve this. I know we can do it using BLOG but not sure how to do this. Can someone pls show an example.
TIA
Harry.
|
|
|
|
|
Anyone had a problem with Crystal Reports error "Cannot find KeyCodeV2.dll" when running an app that has been installed using the windows installer, on a machine different to the development machine? This VB.NET app runs fine on the development machine.
Seems that Crystal Reports is less than ideal with dotnet. Are there any better alternatives?
|
|
|
|
|
i figured this one out today actually, it took me forever.
Ok you have to add a few merge modules to your deployment project, not in the filesystems just add them to the deployment project. Right click on the Deployment Project name in the solution explorer, select Add then "Merge Module..." You will find these modules in C:\Program Files\Common Files\Merge Modules
The ones you need to add should be the first 4. They are...
Crystal_DatabaseAccess_2003.msm
Crystal_DataBaseAccess_2003_enu.msm
Crystal_Managed2003.msm
Crystal_regwiz2003.msm ( this one puts the required registry keys in the client machine that causes the
Keycode error)
Next you need to right click on the Crystal_regwiz2003.msm and click properties
Look in the properties window, click the + sign beside (MergeModuleProperties), Enter the License Key
You get the license Key when you register Crystal Reports, so make sure Crystal Reports are registered. If you lost your keycode i think you can go to the website and get it emailed to you. Go to your report in your project, right click in the toolbox and click "Register/Change Address". I think you can obtain your Key that way. But thats all i can tell you. It should work because i was getting the same thing.
If you possibly know how to write an install package for a SQL/Vb.net app please let me know.
|
|
|
|
|
Joey - great feedback - I appreciate the advice. I did everything you said and have got rid of the error message. I don't know how you figured it out - I couldn't see any help on this.
Now I have a different problem:
When I run the app on the new machine, and I click on the viewer to view the report, I get a crystal reports database login form with text fields "Server name", "Database name", "Login", "Password". The ServerName field has the original path and filename of the Access database I used to hold the data for the report. If I key in the new path to the Access file, it works, but I really want the user not to have to see this stuff. Is there any way to hide this screen?
I am sorry to say I do not have much experience with writing intaall packages for SQL - I am breaking new ground with this stuff right here.
|
|
|
|
|
Let me get back to you on that one. Im dont know right off the top of my head but I will look at it sometime today.
|
|
|
|
|
Oh yeah, what kind of database are you using?? Access??
|
|
|
|
|
Yes, it is Access. Sorry for the delay.
|
|
|
|
|
I have a combo box for displaying user name, retrieve the name from database. Can I set value for each item in the control?
andy(name) 4(ID)
charlie(name) 8(ID)
where do I put the value 4 and 8? Get it? I'm using VB6. Thanks.
<italic>Work hard, Work effectively.
|
|
|
|
|
It's been a long time since I've been in VB6, but IIRC, you're looking for the ItemData property. Docs[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
:-DSomebody help me
I would like to know what is the codes that i should write in the VB6 to read/write sms from my mobilephone via serial port...
Thank you
|
|
|
|
|
There are two parts to this project...
Google results for "SMS Messaging VB6"[^], and results for "VB6 Serial Port"[^]. What commands your cell phone understands and the data that it returns only you can search for.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi! Looks I have a very simple problem, buts its killing me. I want to read data from a text file and put it to a unique variable. For example:
data in Text file looks like
10 20 50 60
20 40 60 20 80 90
I want to read so that say a=10, b=20, c=50, d=60, e=20, f=40 and so forth.
usually in fortran etc. it used to be simple: read a,b,c,d,e,f....
How should it work in vb.net
Thanks.
Amanjot
|
|
|
|