Use Parralel Process In Background Without Blocking Pplication?
Oct 25, 2010I am trying to use parallel processes in baclground but it looks like it block the application till all the processes are not completed.[code]...
View 7 RepliesI am trying to use parallel processes in baclground but it looks like it block the application till all the processes are not completed.[code]...
View 7 RepliesI am a novice in Threads, but I want to know how to order thread execution in my scenario, and is the following :
UI Thread : Windows Form Background
Thread : Kind of print daemon
implemented with recursive methods
IO Operation : a StreamWriter that do
the job of File.AppendText()
When I execute my main app.exe, sometimes it launches the Windows Forms and the execution process in the task manager (app.exe), in some opportunities its just launches the execution process in background. How can I determine the behavior of launching UI, I have to establish a priority or somewhat else? Code: I'm using framework 2.0 and any answers could be writted in C# or Vb.Net.
I am trying to block a list of processes from Txt file/ Listbox System.Diagnostic.Process using Timer. Here's the timer codes
[Code]...
I can block processes from the list using SelectedItem, but it doesn't block all the process in the list.Using while loop causes a deadlock error here. I'm now using aBlock.ReadLine to read from txt file and block the available process. However it is only able to block the first process. Need some guidance to get this code to block all the processes in the list.
I tried to make process that monitores file for changes , makes its md5 hash and outputs.
[code]
Dim f As FileStream = New FileStream(filename, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite, 8192)
Dim md5 As MD5CryptoServiceProvider = New MD5CryptoServiceProvider
md5.ComputeHash(f)
[code]....
It doesn't output at all, it seams to freeze or smt.
I'm using sendinput to send keystrokes to external applications launched from my main application. However , the only way I have been able to get it to work is by focusing the external application then sending input. I want to know how to use sendinput to send keys to a background process without giving it focus.
View 1 RepliesInstead of making a WinForm for my application, is there any way to let it operate in the background without a form or anything?
View 1 RepliesI wanted a ProgressBarStyle.Marquee animation while a query is running. I don't want the user to think the application is locked up. it's really not progress just MarqueeAnimation. the issue I have is it's not running as a thread or in the background.
Private Sub ButtonExcute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonExcute.Click
ProgressBar1.Style = ProgressBarStyle.Marquee
ProgressBar1.MarqueeAnimationSpeed = 60
ProgressBar1.Refresh()
[code]....
I am working on a project and i have come to designing my splash screen... i dont want a useless one what just shows a loading bar what does nothing, im trying to make it useful and show while the main form is loading however this is proving to be a pain in the backside.. i can make the splash screen load when the exe is executed then close when the form is ready but i want to add an animation to the form (just a moving logo) this is just done by me running an timer what changes the location at each tick.. i can get it to work well on its own but when i add frmMain.show() to the code to load the program the animation will not work... i only get this when i ask the program to load the main form..
View 2 Replieson the loan of my application i created a background_worker to pre-load some of my child forms. here is the problem - it seems that the forms gets loaded into the second process and it wont have any affects on the original process .
In another words when i try to show the preloaded form nothing is displayed. How can i ask the background process to "Merge" with the main process when it is completed! i am not sure if merge is the best word to describe what i am trying to do here!!!
also if i try to re load the form that was created by the main process i will get exception saying you can't change one some that was created by another process
I'm developing app in VB.NET 2008.
I have one prob that i'm creating excel sheet runtime, loading data and printing excel sheet through my application. Actually it has 150 sheets to print.
i'm printing by using this code
xla.Sheets.PrintOut(Copies:=1, Collate:=True)
To print 150 sheets , its taking around 17 min. so now the user is waiting until printing process finish(ie 17 min ) .
actually i don't want to make him wait, i want to execute this printing process in backgroud. so the user can work on other process in my app.
how to print this in background ?
What I'm trying to do is show a form while a background process is running. Similar to a progress bar but not a progress bar. We have a form that has an animated gif (customer request) and that's it. no other controls. They want this form to show while the processing in the background is running.
View 5 Repliesi've the need to close an ffmpeg conversion started in background with the vb.net process.start.I've seen that an ffmpeg could be closed by hitting the key 'q'.How can i send the 'q' key to the running ffmpeg process?
i intercept the process with this code:
Dim pProcess() As Process = Process.GetProcesses
For Each p As Process In pProcess
If p.ProcessName = "ffmpeg" Then
[code]....
I develop an appliaction which is running a process in the background. This process is "forked" from the application (I'm not using threads). The process may take a few minutes while the 'father' application is waiting to the process output, so I'd like to enhance the application with the following:
a) a "Stop" button (like in IE, FireFox) to stop the process in background
b) A status bar that displays what's going on while the process is running in BG.
how to draw a button or status bar of course... I mean how VB.NET handle with stopping or displaying while something else is running in background and how to do it.
I have got a couple of VB Powerpack Ovalshapes on my Form.I use these for a quick indication if the networked device is online or offline.I can't seem to control the Visible function (or any other function for that matter) one my Background Worker is running.For my Textboxes I used a guide by jmcilhinney which worked great for them but there is no 'Invoke' property for graphics controls.
View 1 RepliesI have a spreadsheet that contains details of change requests; one row per request. This information needs to be copied into a Word form for sending off to our customer who then completes the response section. To speed up this process I have written some code that utilises the mail merge feature of Word and merges the relevant info from the spreadsheet into a Word form. This runs from Excel when a button is pressed.The problem comes when I go to save the workbook and exit Excel; it stays running in the background as a process in task manager.
[URL]
I'm fairly sure it has something to do with the merge code itself but my knowledge of VB is enough to grasp what is happening but not why it is happening. If I open the Word doc that has the merge fields in it, then open the spreadsheet that houses the info Excel says the workbook is already open.
I have written a windows service that is meant to launch a notepad when a specific action happens. The problem i have is that even though the service launches notepad, the actual notepad it self is NOT visible. I know that it has been launced because i can see the process in the task manager. By the way the process is listed as a SYSTEM process rather than a process under my user name (i believe that is because my process is a "LocalSystem" one).
View 4 RepliesI was wondering if it would be possible to block a website, such as "www.proxy.com"
Through Internet Explorer, not one of my custom ones of my form.
The subject sucks, but the problem is straightforward. I have an existing WCF service. There are a small series of functions, currently. One or two of the functions will need to be performed with a bit of security, for which I need a username and password. The username and password will be checked on the server side against a webservice running on localhost. One alternative is to not use the localhost webservice for the validation, but then I wouldn't have a question, so ignore that.
The way the webservice will work, I was thinking that I would use an invisible web browser, navigate to the REST-style URL, and wait for the response. It's the bit about waiting for the response that is causing me trouble. Normally, I'd wait for the document comleted event raised by the browser control, but since this is initiated by the call of a WCF service function, that won't really work. The WCF function call can't 'wait' for anything, nor will it receive the event. Once the WCF function reaches the End Function statement, it is over and done with, and returns. The response from the webservice won't have arrived by then, so that won't work. There are two typical solutions to this, one of which is horrible to the point of being unworkable.
1) A busy wait, or spin wait, where the WCF function goes into a tight loop waiting for the browser event to be raised. This is never a good idea, and is particularly terrible in this case, because the WCF service is running on a web server, so the negative impacts of a busy wait are FAR worse than normal.
2) Use something like a Mutex in the WCF function such that the function launches a thread, the thread immediately grabs the Mutex, then begins the navigation. The WCF function waits on the Mutex, which would mean blocking without spinning, and the document completed event pulses the Mutex to release the WCF function so that it can return the proper response. This seems technically improbable, as it stands.
The problem is only a slight variation on a very typical problem, yet it presents some interesting problems. Windows is event driven, but a WCF service function is not. A callback across a WCF (at least across this one), isn't an option, events aren't an option, so it all comes down to the function starting a process, then blocking without spinning, until the process comes up with an answer.
I have a class that has purely static Methods and properties. I am calling an async method on the class "Load" that asks a web service for a chunk of data, which then fires an event that executes the return method, "LoadCompleted". I have no idea how long the call is going to take (the difference between calling the "Load" method, then the "LoadCompleted" getting called).
I would like to block the application from proceeding any further until the callback method has been raised (as the app will try and get stuff from this class, which isn't populated until the "LoadComplete" method sets the data).
I am trying to make an app in VB.NET that pings ip's on a specfic port that are connected to my computer and if it is greater then 500 the person would be blocked from connecting to my computer. How can I do this in VB.NET?
View 1 RepliesI am creating a security program. One of its features is that it blocks inappropriate web sites. I might need help determining which sites are bad and which ones are good. If I could 'read' every work that is displayed in the browser then I could tell, but that may come later.
So, I'm looking for some kind of hook that will allow me to cancel the site if needed. It should be able to still be hooked in Safe Mode, as well... I'm sure that this is going to be an easy one!
I wish to block websites in a browser, where the blocked websites are stored in my.settings.blockedwebs (which is a collections. specialized. stringcollection). I let the user input the blocked website into a textbox in form1, and the add website to the stringcollection button has the following code:[code]
View 15 RepliesI am unable to get on to internet explorer or IM on my laptop . I am using Windows XP.Each time I log-in it says my firewall is blocking.
View 4 RepliesI'm trying to wait for a Task result in .NET 4, much like you can by using the await keyword in .NET 4.5. I just can't figure out how to do it though...My code (to prove that I'm atleast trying):
Private Function GetXDocumentFromWebLocationAsync(ByVal request As WebRequest) As XDocument
Dim queryTask As Task(Of WebResponse)
queryTask = task(Of WebResponse).Factory.FromAsync(AddressOf request.BeginGetResponse, AddressOf request.EndGetResponse, Nothing, Nothing)
[code]....
As you would expect, the GetResponse calls are executed on a different thread, but the function has to wait for the result before it can return. Unfortunately this blocks my main thread until the task has completed and I don't have the slightest clue on how to make it wait without blocking. I don't want to use the Async CTP either because that's just running away from the problem.
Is there a synchronous wait function that won't tie up the UI-thread in .NET WPF? Something like:
Sub OnClick(sender As Object, e As MouseEventArgs) Handles button1.Click
Wait(2000)
'Ui still processes other events here
MessageBox.Show("Is has been 2 seconds since you clicked the button!")
End Sub
Is there a way to include an ActiveX to VB .NET project without adding it to a form?
If I add it to the form and call a function on it that blocks, the UI is unresponsive until the function returns. Even if I am making the call in a different thread.
I was able to compile the code when I did not include it via the form, but got this error once I called a function on it.
Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
How could I make the UI responsive when the ActiveX functions are blocking?
I create a .net dll on the fly with codedom then I load it with Assembly.LoadFrom like this:
Private Sub Test()
Dim ASM As Assembly = Assembly.LoadFrom("test.dll")
'Do some stuff with the loaded assembly...
[code]....
I have been reading the async design patterns on MSDN and the general idea makes sense to me but in practice it is proving to be more difficult. I am working on a project utilizing VMWARE VIX.
HTML Code: [url]. Each function such as connecting to a host server, retrieving properties, etc. can be executed in two different ways.
Connecting to a host using a blocking Wait:
Code:
Dim m_lib As New VixLib
Dim m_hostJob As VixCOM.IJob
[CODE]...
Code:
Dim m_lib As New VixLib
Dim m_hostJob As VixCOM.IJob
dim m_callback as VixCOM.ICallback
[CODE]...
The problem with the VIX SDK is that sometimes the functions never return, hanging the application. dblock.
HTML Code:[URL] came up with a library that specifies a timeout value. When the timeout runs out the method aborts and returns regardless whether it finished or not.
The callback method is an active wait where the code continues to execute. What I want to implement is a blocking wait with a timeout. The ICallback interface has one sub OnVixEvent(IJob,Integer,IVixHandle). This method is fired at least twice, first when some progress is posted and second when it is complete. The first call to this method can be one second after registering the callback or 30 seconds, so I can not rely on this method to block the main thread. how to create some kind of async result class that would block the main thread from executing until either a timer runs out or the OnVixEvent method returns an Operation Complete signal that also implements ICallback.
how to or have a tutorial about programaticly blocking a webpage from webbrowsers? or is this not possible because it would need to be done on a router level?
View 2 RepliesI am developing a hotel software product, and one of the features required is to be able to display the room numbers in the hotel, and then the status of them for each day of the month.
I am trying to create something similar to a DataGridView control where at the top the column names are the dates of the month, and to the left is the room numbers as rows. Please see the below screenshot of the function I wish to have. However I do not know what control or function they use to create this grid below (it is from an existing product). I need to not just be able to join multiple cells together when it is the same person in the room for multiple days, but also allow drag and drop ability.
Currently I have a DataGridView control and am able to simulate the below screenshot, however with a datagridview control I am unable to join cells across multiple columns nor allow drag and drop ability between rows.