Application Hangs On Call To Doevents?

Dec 22, 2010

I am re-posing this question because the prior post has gotten really full of side issues so I fear the main problems has been lost.I have a windows forms application written in VB.NET which scrapes information from serveral web pages? I am having problem with one particular site where partway through the page navigation my application hangs. When I press pause (or break) in the debugger, it stops on a call to System.Windows.Forms.Application.DoEvents.

View 7 Replies


ADVERTISEMENT

Application Does Not Return From Call To System.Windows.Forms.Application.DoEvents?

Aug 2, 2011

I have a windows forms application written in VB.NET which scrapes information from serveral web pages (who doesn't right)? Anyway, I am having problem with one particular site where partway through the page navigation my application hangs. When I press pause (or break) in the debugger, it stops on a call to System.Windows.Forms.Application.DoEvents.

Resuming execution shows that it really is stuck on this line (it does not reach the next line of code). It also hangs about the same point each time I run it (at least its consistent). Since System.Windows.Forms.Application.DoEvents yields to other threads on the same processor and then resumes execution of the current thread, I think the problem is that some other thread is not behaving well (not returning from some event handling code). I thought Windows 7 was pre-emptive, which makes me
doubt that theory but I really don't know.

[Code]...

The program scrapes somewhere between 12 and 14 pages before it gets stuck on the call to DoEvents. Does anyone have a clue why this would happen? Why would any call to DoEvents hang?

View 1 Replies

Call Same BackgroundWorker Multiple Times Without Using Application.DoEvents

Mar 4, 2010

I'm running in to a problem that I was able to fix with Application.DoEvents, but don't want to leave that in because it might introduce all sorts of nasty problems. Background: Our app is primarily a desktop app that makes many calls to a web service. We control everything but changes to the overall system design are not going to be seriously considered. One of those calls, Calculate, is used very often, and occasionally can take a few minutes to process all the data to return valid results.

[Code]...

View 1 Replies

Application.DoEvents() Function Halt And Crash Application In Windows Vista

Jul 18, 2011

i made an application for serial communication. for this application i need to set delay time. during this delay time i m doing some other task. So for those task i need to take back control from delay function, for this purpose i am unsing Doevents() function.Its work fine On other OS (XP, Windows7 32/64-bit). But Application.DoEvents() function halt and crash in windows vista.

Private Sub TimeDelay(ByVal DT As Integer)
Dim StartTick As Integer
StartTick = Environment.TickCount()

[Code].....

View 4 Replies

Program Hangs During Debugging At A Breakpont Set At A Subroutine Call

Jul 5, 2009

My program hangs during debugging at a breakpont set at a subroutine call. It hangs on breakpoints anywhere inside the subroutine also. But does not hang otherwise at other locations where I have set breakpoints.

[Code]...

View 4 Replies

Application.DoEvents Alternative?

Jun 6, 2011

Any good alternative to using DoEvents in VB.NET

View 6 Replies

Exit Out Of Application.DoEvents() Loop?

Dec 15, 2009

how to exit out of the Application.Do() as i am hanging in that .Here is a sample of my code.

Imports PDFCreator
Imports System.Windows.Forms
Public Class Form1

[Code]....

View 3 Replies

Hooking In To Application.DoEvents Method

Jul 25, 2009

I am not very familiar with VB.NET so I don't know if this is possible.Some code I am working on is setting the properties of a very large class. In the setter of each property an event is raised to indicate that the class data has changed. An event handler then serializes the instance of the class to a database.Obviously I do not want this to happen after each property is set, so I need to either have a delay before saving, or something else.I am keeping a large list of instances in a cache implementation already, so one option would be to only process the cache every now and then and save all unsaved instances in cache to the database.So I tried to see if I could derive a class from Application (and override DoEvents), but it is NotInheritable, so no luck there.

View 3 Replies

Net Not Responding, Application.DoEvents And Threading?

Mar 8, 2009

My mdi VB.Net application performs a long operation on some data. Ideally I should use a separate thread to prevent the dreaded "Not Responding" message.My problem is if I use a separate thread users then have the ability to click on other controls in the application which can directly affect the operation my background thread is working on, creating an error.

Is there any way to prevent all the mdi windows, toolbars and other controls from receiving mouse clicks and keyboard input during my background thread's operation?

Or is there a way to clear the message que before performing a Application.DoEvents?

View 5 Replies

VS 2008 Unable To Use An Application.DoEvents?

Dec 11, 2009

I have a unique situation in that I've developed a VB.NET application for AutoCAD. The way this works, you build your project into a dll and utilize AutoCAD API references when designing the project. From AutoCAD, a "Netload" command will load your dll into it's namespace to run. AutoCAD then essentially takes ownership of your application from here on out. The application is ran using a command defined in a method's attribute:

<CommandMethod("CommandNameForApp")>Public Sub MyCommand()
'Code Here
End Sub

Due to the heavy load of processing loops as it evaluates AutoCAD drawing data, processes this data, and generates many, many Excel reports, I've added a boolean property called Cancelled to my Progress class. When the user cancel's the process, this is seen by the process and further evaluation is ended and everything is cleaned up nicely. In order for this to work though, I have to implement Application.DoEvents. Without it, the Cancel feature will not work at all. With it, now instead of allowing the application to stay loaded, the Command method is fully closed.I have added a go-to point and simply verify that the application isn't closing because of a user-cancellation event. Here's what it looks like now:

<CommandMethod("WireShop")> Public Sub WireShopApplication()
'Initialize Configuration File Data
'Initializes ValidBlocks, MarginDistance, WindowDistance, and HelpFileName Properties
If ConfigurationFileInitialization() = False Then Exit Sub

[code].....

In my opinion, this seems a little hokey. However, I'm not that familiar with exactly what Application.DoEvents is doing in the background to understand how to "head it off at the pass".

View 11 Replies

Application.doevents() Causing Some Sort Of Overlap?

Nov 9, 2009

I'm trying to automate the process of logging into twitterfeed.com, and filling in the information (the feed url and twitter username are pulled from textboxes). I had it mostly working the other day, even if it is a bit sloppy (the only way I could get one button to click is to send 50-some tabs). However, lately it seems to enter in a sort of loop. When I pause the program, Visual Studio indicates that it is the Application.DoEvents in the Private Sub "wait" that is still running even after it should be.

Public Class Form1
Private feed, username, temp As String
' Code stolen off of a website as an alternative to sleeping, or trying to do a timer + while combo like I had been doing

[Code].....

View 1 Replies

C# - Stop Developers From Calling System.Windows.Forms.Application.DoEvents()?

Mar 15, 2009

We just spent 300 man-hours fixing a buggy application in the field. It all came down to calling Application.DoEvents (re-entrancy problem).This was not caught in design reviews, code reviews.The code was inserted two years ago with the first version; the application was always "flaky" but recent changes exposed the re-entrancy problems to a greater degree. This incident is the second time in our organization that Application.DoEvents caused failures and multi-man hours of debugging.It was discovered in this case by simply noticing the call,buried way down in a complex event handler for an asynchronous task.What do you suggest to prevent this issue from happening again:

Add checkin gates to source control?

Developer training?

Code Analysis rules (why is this not already a built-in rule?)

How to I enforce a coding practice?

View 8 Replies

.NET Application Hangs When Calling DLL

Dec 28, 2010

Its been running in production for over a year and this is the first time I saw this behaviour. The application is a VB.NET Console Application which is triggered by MQ server. This application uses a class library which is part of the same project(Say 'abc.dll'). In production around 40+ instances of this exe are running and all of them use the some of the functions from 'abc.dll'.

Last week, we noticed that all the 40 instances were shown to be running in the task manager but they were not doing any activity. There was no exception thrown or error logged in Application logs or System logs. To frantically debug the problem, I tried isolating the problem.

With all these 40+ exes hung up, I wrote a small aplication which would use a reference to this 'a.dll', create an object of one of the classes in that dll and execute a method in there. I was printing console.writelines in between to see to which point it gets to before erroring out.

To my surprise, I found that at the point where I was creating an object of a class in 'a.dll' this sample test application would also hang just like the others. No exceptions thrown. So I killed all those applications as a last resort and then when I restarted all of them, everything worked fine.

I couldn't find any explanation for this behaviour. Since it was a critical error affecting a production system(blanking out the application for 3+ hours), I have to give a very good explanation as to why this would occur. how it can be prevented in future.

(Side note: the servers running these appilcation do not have a maintenance schedule and are supposed to be up for couple of months together.

View 11 Replies

VB 2008 Application Hangs?

Mar 6, 2011

I am writing my first application in Visual Basic Express 2008 and the program conistently hangs (Not responding in the Task Manager) midway through execution. The operating system is Windows XP Professional SP3 running on a 1.20 GHz Intel Core Duo CPU with 2 GB of RAM.

The application has very deep layers of subroutines and functions, all of which are using lots of math routines. There are no recursive routines anywhere in the program. The program creates and destroys quite a few class elements, and I have written dispose methods for all of them using IDisposable, setting all the properties to Nothing. I also use GC.Collect() to force garbide collection, and GC.WaitForPendingFinalizers(). As a result, I don't think there are any memory leaks.

I think the depth of sub and function calls are causing a stack overflow, but I'm not certain. I have tried without success to increase the stack allocation to 2 Mb using Editbin.exe after reading some forums, but nothing changed. I then searched my machine and did not find EDITBIN.EXE.When the program hangs up, the background of the forms on the screen turn to solid white and the controls are no longer visible.It looks like a window pops up but it disappears too quickly to read anything. If I view the task manager while the application is running it hangs immediately. I have not published it, I am still developing and running it out of the VB environment.The more complexity (sub and function calls) I add, the earlier the program hangs.

View 6 Replies

.Net Application Hangs If Lock System

Jun 21, 2010

I have a weired problem. I developed a multithreaded WinForm application using VB.Net, and SQL Server 2008. The application works perfectly fine if I am using Visual Studio IDE to run the same. But, if I run the exe file created by VS the application hangs in case I lock my system and again relogin. The memory usage is same as it was before locking the system. CPU usage is also 0% or by max 2%. All threads are also exited after finishing there designated tasks.The application also uses threading but all threads are exited after there designated tasks. I confirmed this using various tools.[code]

View 5 Replies

.Net Application Hangs When Added On Startup?

May 5, 2011

I have created a small multithreaded application using VB.NET. There is no problem when the user manually runs this application. A problem exists when I added this application on startup. It hangs after I rebooted the system. The application is still running its thread but I can't see its GUI because its frozen. If I kill it on task manager and started again, the application works fine. What could be the possible reason/s why this application hangs when added on startup?

Imports System.Threading
Public Class USBLock
Public Event Lock()

[Code]....

or just a thought on this subject: the reason why the program hangs on startup is because the application is loaded while the .net framework service has not yet started.

View 1 Replies

Application Form Hangs But It Is Working

Apr 21, 2011

I have win7 pro, on my win form is a traffic light icon(when it starts it is red, when finished it is green), so that I know when job is finished. But when I run application icon isn't changing and form hangs it self, can not do nothing until job is finished. Only in the end, I see that icon is quickly changes to red and then back to green.

View 1 Replies

Thread.join() Hangs Sometime Windows Application?

May 31, 2012

I am developing windows based video application, in my application I have to make multiple video files with different duration from a single video file. To achieve this I am using thread.join method(), when I run my application it works fine but sometimes it hangs and I have got to close my application using Task manager, I can't understand why my application behave like this?.

This generally happens when number of output files are more than 40. Is there any problem with thread.join() function, when number of threads are increased. I am generating a new thread for each output file because this is the limitation of the third party dll which I am using.

View 4 Replies

Application Hangs When OpenFileDialog = Windows.Forms.DialogResult?

May 19, 2010

Private

Sub Button1_Click(ByVal
sender As
Object,

[code]....

View 9 Replies

Excel Instance Hangs In NET Class Project Application

Aug 7, 2009

I am writing a class project application that is loadable from within AutoCAD. This application generates an Excel workbook with extracted data. I am having a problem with Excel closing when finished. It seems the Excel instance hangs until my application is unloaded. I have found the section of code that seems to be causing to hang, but I'm not sure why its hanging to prevent it.

Below is a copy of my code for the class (top to bottom with exception of the FileExistValidation method... too many characters ). The code section that is commented out seems to be what is causing it to hang. If I uncomment that, Excel hangs, with it commented out, Excel closes out in the background.[code]...

View 10 Replies

FAXCOMEXLib - Sending Fax - Application Hangs When Try To Cancel The Print Dialog Box

Apr 18, 2007

I have a problem when it comes to faxing html. Im currently using FAXCOMEXLib because I'm sending to a remote fax server. Sending html files causes the function ConnectedSubmit to display a print dialog box before sending the fax. The application hangs when you try to cancel the print dialog box, it seems like the ConnectedSubmit function does not return to previous line where it was called.

[Code]...

View 1 Replies

VS 2010 Application Hangs While Moving Data From Text File To Datagridview

Jun 22, 2012

I have a text file which contains large amount (around 44,948 rows/lines & 9 columns) of delimited text data in a text file which I want to populate onto a DataGridView table. I have written the below code, but the application gets hung for the rest of the time & so I have to stop debugging the program.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim x As New IO.StreamReader(fileLocationTxt.Text)

[Cdoe].....

View 5 Replies

Call External Windows Application Form From Application?

Aug 17, 2011

I Have one Windows Application in which i have one MDI Form (Say App1). And I too have another Windows Application in which I have a Child Form (Say App2). So now i want to Call App2 from App1 .. And want to Display App2 form As MDIChild in App1 MDI Form . I am Able to open the Form of App2 , But how to set It As App1' Child .

View 2 Replies

Skype4COM - Make A Skype Application Using VB - Application That I Call You?

Aug 27, 2010

I'm going to make a Skype application using Visual Basic, I use them "Skype4COM.

Below is a link on the page somewhere in the middle Skype4COM. It is the DLL that I use.

But my question is, how can I in my application that I call you? Not that you're on the phone but if someone phoned you before you've pressed record.

View 2 Replies

What Can Use In Replace Of The DoEvents() In Vb6

May 23, 2005

I am using ASP.NET and was wondering what i can use in replace of the DoEvents() in vb6?

View 5 Replies

What's The Equivalent Of The VB6's DoEvents In .NET

May 4, 2009

What's the equivalent of the VB6's DoEvents in .NET?

EDIT:I have a Sub that takes a long time to do its work. (it has a do-while) when I call it, The form turns white. in VB6 I used to put a DoEvents in the method (inside its do-while) to prevent this.

View 3 Replies

How To Cancel BackgroundWorker In WPF Without DoEvents

Jun 2, 2011

I have a search box that works great in WinForms, but is giving me trouble in WPF.

It works by starting a search each time a letter is pushed, similar to Google.

[Code]...

View 3 Replies

VS 2010 AccessViolationException - .DoEvents

Apr 9, 2011

I have a simple loop that "sleeps" a thread..Out of nowhere i will get this error below, it could be 1 minute, 20 seconds, 5 seconds, all at random times...how to fix it?

View 7 Replies

Use Shell To Have Application Call An External Application But Its Not Working - Error: 'System.windows.shell'

Jun 3, 2011

I'm trying to use the Shell to have my application call an external application but its not working...I don't understand why. I get the following error: 'System.windows.shell' is a namespace and cannot be used as an expression!

Heres my code....any ideas what I'm doing wrong. Its got to be a simple...stupid error.

Private Sub mnuUpgrade_Click(ByVal Ctrl As Microsoft.Expression.Web.Interop.Legacy.CommandBarButton, ByRef CancelDefault As Boolean) Handles mnuUpgrade.Click

[CODE].....................

View 2 Replies

VB2010 - Call Application.Run() In Application Without A Form - "Object Reference Not Set To An Instance Of An Object

Nov 12, 2009

My problem is when i try to call Application.Run() in a application without a form i get "Object reference not set to an instance of an object." when i run it outside VS. but if ran in debug or release mode it works just fine. i may just be forgetting to setup application right, but ive done it before in this same manor and it worked fine.

Sub main() 'this runs first.
AddHandler Application.ApplicationExit, AddressOf ExitEventHandler
dbg_f("handle added")

[CODE]...

Commented out init_timer and init_ready, and now it causes the same error for the myName line. there seems to be something wrong with class Application. btw theres seems to be something wrong with the forum code formatting.

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved