|
I was wandering if there was any way to supply a new set of arguements to an already running process using vb or any other language whether it be dos, c++ or c# ?
I have a program i have written that not only edits files but launches a program with a set of arguements from the user, and this works fine but i want to add functionality to my program by adding a way to change the arguements supplied to the process without haveing to shut the entire process down.
|
|
|
|
|
I think you can use some sort of IPC (Inter Process Communications) or, if your process has access to shareable resources (such as files or databases), it can poll for changes there.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I appreciate the input, im currently researching the ipc and how this may help my application along. Basically the program allows users to launch a specific executable and use information from ini files (user specified) to pass arguements to the process prior to launching (thus avoiding writing multiple bat files). But after the process is launched the user pretty much looses control of that executable (this is the manufactures fault) and im trying to find a way to give some control back to the user. Basically what im trying to accomplish is getting the process to restart (without shutting down completely) with a new set of arguements thus giving it more functionality.
As i just started reading the about ipc i havent quite come to the conclusion if this will be what i need or not, i have seen that it has the ability to pass info thru networks ect... but havent gotten all the time to read more into it.
If anyone knows how ipc works or any other way to accomplish my task i would appreciate the input.
Thanks in advance
|
|
|
|
|
BTW you can also change the values inside the INI file. But then your process has to periodically check the INI file for changes.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I have buttons in my menu strip on my MDI parent form. How can I center these buttons on the menu strip???
|
|
|
|
|
I have buttons in my menu strip on my MDI parent form. How can I center these buttons on the menu strip???
|
|
|
|
|
Sorry, this should be obvious, but I don't know it.
How do I pause my program execution until another event fires?
Thanks
|
|
|
|
|
you have to do nothing, a Windows application sits down waiting for the next event...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
In my program, when a specific action is taken, the form generates a tablelayoutpanel. this table layout panel requires, in different circumstances, to have a different amount of cells. The cells need to be of equal size. How would i go about this? I have no idea how to programatically set the amount of rows and columns, is there a way?
Posted by The ANZAC
|
|
|
|
|
Hi,
Could anyone help me?
I'm trying to set a text box so the contents scrolls across the screen (right to left - like a news ticker). I've found some part examples using picture boxes, but was hoping for something more basic, with just a textbox/label etc - and a timer. It doesn't matter if the motion is jerky - so long as it works!
I was thinking it would be something like sending the text to a temp location then on a timer tick it changes whats in the text box so everything it one/two characters further over. I'll need to make sure the whole message is displayed before the first letter reappears at the start.
Any help would be much appreciated
I'm using Visual Studio 2003 (VB.net)
Many thanks
Matt
|
|
|
|
|
Might be a bit messy, but i did throw it together in a couple of mins so...:
Dim text As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
text = Me.Label1.Text<br />
End Sub
Dim leftbound As Integer = -1<br />
Dim Right As Boolean<br />
<br />
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick<br />
If Me.Label1.Text = "" Then<br />
Me.Label1.Location = New Point((Me.Width - leftbound), Me.Label1.Location.Y)<br />
Right = True<br />
End If<br />
If Me.Label1.Location.X = leftbound Or Me.Label1.Location.X = leftbound + 1 Then<br />
If Me.Label1.Text <> "" Then<br />
Me.Label1.Text = Label1.Text.Remove(0, 1)<br />
End If<br />
Right = False<br />
ElseIf Me.Label1.Text = text Then<br />
Right = False<br />
Me.Label1.Location = New Point(Me.Label1.Location.X - 2, Me.Label1.Location.Y)<br />
ElseIf Right = True Then<br />
If Me.Label1.Text.Length + 1 <= text.Length Then<br />
Me.Label1.Text = text.Remove(Me.Label1.Text.Length, text.Length - (Me.Label1.Text.Length + 1))<br />
Me.Label1.Location = New Point(Me.Label1.Location.X - 1, Me.Label1.Location.Y)<br />
End If<br />
End If<br />
End Sub
Posted by The ANZAC
|
|
|
|
|
Thanks, I've tried that - however it isn't quite what I was after. The label box in that example has to be big enough for the for the entire message els it wont all be displayed. Say the label is wide enough for 30 characters, but the message is 45 - is there a way to scroll the entire message across the box before restarting?
Thanks for your help
|
|
|
|
|
Maybe save the trouble and download a marquee control, i'm sure there are plenty available,
Posted by The ANZAC
|
|
|
|
|
Dim s As Integer = 70<br />
text = Me.TextBox2.Text.PadLeft(s) & Me.TextBox2.Text.PadLeft(s)<br />
Me.TextBox2.Text = text<br />
<br />
Dim c As Integer = 0<br />
<br />
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick<br />
<br />
Me.Timer2.Interval = 60<br />
If c = text.Length Then<br />
c = 0<br />
Else<br />
c += 1<br />
Dim a As String = text.Remove(c, text.Length - c)<br />
Me.TextBox2.Text = Mid(Me.TextBox2.Text, 2) & a.Remove(0, a.Length - 1)<br />
End If<br />
<br />
End Sub
Note: Set s until you get desired effect
Posted by The ANZAC
|
|
|
|
|
Thanks for that.
It scrolls perfectly
VB doesn't seem to like this line though
text = Me.TextBox2.Text.PadLeft(s) & Me.TextBox2.Text.PadLeft(s)
Also I can't see how to change the text in the scroll, I tried but after the first time it scrolls I just get "Form1Form1" etc repeated.
Thanks again
|
|
|
|
|
I'm not sure how to fix either of those issues as i didn't have either of them, sorry about that.
Posted by The ANZAC
|
|
|
|
|
Ok thanks
It didn't like that first line as it said "text" had not been declared.
I'll have a play around with it.
Edited to add:
I've got it just scrolling my text now - it only scrolls once though then the box stays blank, so I still need to have more of a play around
Thanks
-- modified at 10:11 Monday 2nd April, 2007
|
|
|
|
|
Sorry in the code i posted just before i meant to declare text outside of any subs, this shoul work with the original code, it did on mine.
Posted by The ANZAC
|
|
|
|
|
The only way I got it to accept those two lines were to put it inside the windows form generated code.
It works fine then - just adds whatever text I give it to the form caption bar too!
Matt
|
|
|
|
|
hey ive been messing around with vb .net 2005 and i got an idea to attempt a program that uses voice recognition. ive looked around and ive seen code in other languages and not really vb .net (i saw one in vb 6 but i dont have that). i was wondering if anyone could point me in the right direction of where to begin in trying to start voice recognition, thanks
|
|
|
|
|
Do a search on MSDN for Microsoft's Speech SDK (free to download) ..
Once installed you can embed speech into your vb.net applications ...
Regards,
GaryW
|
|
|
|
|
there any guide to implementing, or is there documentation with the SDK on implementing it? thanks
|
|
|
|
|
Yes .. there's a pretty comprehesive help file with the SDK ...
GaryW
|
|
|
|
|
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim SpFlags As SpeechLib.SpeechVoiceSpeakFlags = SpeechLib.SpeechVoiceSpeakFlags.SVSFlagsAsync
Dim Voice As SpeechLib.SpVoice = New SpeechLib.SpVoiceClass
' Speak introduction
Voice.Speak("Hello")
Voice.Speak(Me.TextBox1.Text)
and add references Interop.SpeechLib
there is a site coding4fun where i found out about this one hope this helps
|
|
|
|
|
This example is for getting an app to talk, not to get it to do recognition.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|