473,788 Members | 2,721 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Could Application.DoE vents(); messup code execution ??

Hi,

I have experianced same wierd behavior by one of my customers .....

Here is the thing .... We have the application for newspaper article
management. so adding end editing etc ....

After a while my customer started to complain that they have duplicate
articles in there database ....

so I put some traces on the save event ..... and what I could find out is
that the event method OnClick for save ...

was called 2 or even 3 times in a row ....??? How is this possible ?? What
is even more wierd is that this happens maybe 1 or 2 times from 2500 !!!

I also put some traces when entering the method and exiting the method .....
and I get 2 times enter 1 time exit ?:???

So there can't be error in code .... Ofcourse I COUDN'T repeat this error
not even ones ....

Now the only difference from my PC to customers is that I have .NET
Framework 2.0 SP1 installed and they don't .....

What I did put in the code to force refresh of other processes is :

Application.DoE vents();
Thread.Sleep(30 0);

Was this wrong ?? Could this mess-up the code execution ??
Another thing that happened was when they tried to edit the article and same
it .... and because they changed the media code .... thumb generation
mechanizem puts
new line in oracle table so that the background process creates new thumb
.....

And what happened was that the code (see bellow) was somehow skiped .....
well I can't see if it was skipped or not, but there was 100% no new line
for thumb generation

void OnClick(...)
{
// some adding and updating of the article
Application.DoE vents();
Thread.Sleep(30 0);

if (old_media != new_media)
{
///do our table insert for thumbs .....
}
}

So as you can see i called this :
Application.DoE vents();
Thread.Sleep(30 0);

ones more here in this code .... so maybe this is a problem.....

Would anyone have any clue what is wrong here .

Thanks a lot.
Kris

Mar 20 '08 #1
0 1068

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
6084
by: VMI | last post by:
My Windows form has two buttons: "Start" and "Stop". How can I stop the form from doing whatever it is doing without closing the whole application? The "Stop" button would have to stop a process that's being run in another class, not from within the form. Thanks.
6
4302
by: Ollie Riches | last post by:
I understand the use of Application.DoEvents() to process all outstanding messages on the message queue in a winforms application if you have long running process on the UI thread. But can anyone explain to me why I need to call DoEvents when I am using a COM component that calls back to into the ..Net application? - If I don't call DoEvents after receiving a callback then sometimes no more messages are pumped, it appears that the message...
0
1283
by: Mika M | last post by:
Hi! I'm using Rs232-class, which was shipped with 101 VB.NET samples by Microsoft. Application is made to read COM-port with the following code... Try Me.tmrReadCommPort.Enabled = True If (Not m_CommPort.IsOpen) Then m_CommPort.Open() Dim strCommand As String = ConfigurationSettings.AppSettings("ReadCommand")
13
10106
by: Amjad | last post by:
Hi, Is there an equivalent to the "Application.Doevents" method in modules or Windows services? I want to make a Windows service that calls a DLL. The DLL would have all my functions and it would be doing all the job, but some of the functions that I'm using require calling something like "Application.Doevents" and I can't use this because the DLL module is not an application.
2
2128
by: Lonifasiko | last post by:
Hi group, I must launch from my Winforms application another application (.exe developed by the client) which response time sometimes can be more or less 30 seconds. I'm using ProcessManager class and WaitForExit() to start it and wait till it rsponds me. It's necessary for the application to get a response, that's why I use WaitForExit(). I don't have access to the external .exe developed by the client,
16
12929
by: Alan T | last post by:
I tried to use a thread to process a iterative execution of processes but afraid my thread is not thread-safe. If I am not using a thread, my main form will become 'white' when switch forth and fro between other applications. So now I tried Application.DoEvents(). But it seems does not help, my main form still displays as 'white' when switch between other application.
12
2300
by: Justin | last post by:
I can attach my code if anyone wants to see it however I'll try to ask my question with some mark up code first. I'm having a problem terminating my process while using DoEvents. For example: Button.text = start If button.text = start then button.text = stop
11
5178
by: Don | last post by:
I have a WPF application in VB in VSTS 2008 RTM. I am trying to "blink" (momentarily clear) a field of data if the data is reloaded from the database to give the user some visual indication of the LOAD operation. So on the LOAD button I clear the text fields, do mainCanvas.UpdateLayout( ), and the reload the text field from the database. But the text fields are not cleared long enough to see them blink.
8
3595
by: Bharathi Harshavardhan | last post by:
Hi, I have an application in which I have used Application.DoEvents() method in the click event of a NumericUpDown. This particular method is throwing "Object reference not set to an instance of an object" error.. Does anyone have any idea about it? Regards, Bharathi
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10177
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10113
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8995
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7519
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2896
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.