Forms Running In The Same Application But On Different Threads?

Dec 9, 2009

I have two forms running in the same application but on different threads. HdForm and DataForm. I have a class library whit datasets and a stack in it. Cause both forms (different threads try to rad from the same class library i use a synclock to syncronize. But it seems like the synclock dont work.I get random errors in the HdForm while reading from myAr dataset. It says index out of range. But i know for sure that the index exist (i have make sure of that). When i click on the visual studio play button then, it goes again.If the index was realy out of range then it couldn't go further. So i think the synclock does not work and thus the dataset is changed in time while im the loop reading from MyAr.

[Code]...

View 3 Replies


ADVERTISEMENT

Office Automation :: Outlook - Application Running Multiple Threads

Apr 15, 2009

I have an application, running multiple threads, and in many of these threads, Outlook is being called, some mails read, attachments downloaded, and then the outlook instance closed. But it is possible that there are a number of threads trying to do the same thing at the same time. There is of course a lock at the beginning and end of the process, so that no two threads try to access the outlook application at the same time.

"Sometimes" i get an error message : Creating an instance of the COM component with CLSID {0006F03A-0000-0000-C000-000000000046} from the IClassFactory failed due to the following error: 80010108

View 3 Replies

Forms :: Application Running On Windows 2003 Vps?

Aug 30, 2009

I have a problem with any vb.net application running on my windows 2003 vps. I've tested this by creating the simplest form with just a button on it and executing the following code...

[Code]...

View 4 Replies

Forms :: Bring An Already Running Application In Front?

Jul 19, 2010

I am developing an application having multiple screens appearing one after another using vb.net. My requirement is to bring some screens (windows form) in front of the user to take input and some of the forms can work in background (behind other applications) as they are only progress showing forms.

I tried Me.active(), Me.BringToFront(), Me.Focus(), and also some of the APIs like GetForegroundWindow(),SetForegroundWindow(), ShowWindow() etc, but failed to do so.

I tried another set of instructions
Me.TopMost = True
Me.Active()
Me.TopMost = False

Its works for me but once my form come in front, no other application can appear on top untill the my form is selected manually. Although I tried Me.Select() and Me.Focus() after above mentioned set of instructions but failed.

View 2 Replies

Forms :: Application Unresponsive After Moving Window (when Running)?

Dec 8, 2009

I have an application (written in VB.net 2008) which reads a text file. Parses the record and uses the second field (a UK postcode) to match an Access database (SQL - Select * from Table1 ......), then writes a text file back out with the original input postcode plus several fields taken from the access database.

I have 3 counts happening during the process, records read, postcodes matched and postcodes not matched. I move these values to labels on the form, then every 50 records read, I refresh the form (me.refresh) to update the labels (showing the end user where the process is upto).When running, if I drag the window around the screen, or minimize then maximize, or click off the window to another window, the application seems to freeze and the counter labels do not refresh.

View 3 Replies

Forms :: Experiencing Some Random Locks While The Application Is Running?

Oct 27, 2010

I'm have a quite big application which have 2 serial ports and access 1 DB (running on Background workers). I'm experiencing some random locks while the application is running and I started looking for something that could cause it. One of the obvious possibilities would be if I had in the GUI thread some While_End that would never return.I have one While_End in my GUI thread but IMHO it does not look like it would lock, so I want your opinion: Does the code below looks like will lock?? If 'yes', Why ?

[code]...

Does anyone can imagine a scenario where this While_End would not return ?

View 1 Replies

Running All Threads Not On The GUI Thread?

Dec 7, 2011

I have only managed to use an STA to run a long running excel process with a background worker and 2 delegates.

What I want to do now is have the whole application running outside of the main thread to make sure the UI is always available, I then want to create new threads from the thread I have outside of the main to run the various processes. I will need to have some form of syncronisation in there for certain things to be done once a thread is completed and also I will need to change the button states on the main form to stop certain process being called whilst other processes are running.

This is my code so far, basically this loads in a csv file to a datatable adding manager employee ID and email address, filters it and displays the resultant data in a listview. There eventually will be some filter options as well. There are then 2 options for processing the data, it will produce individual bradford factor reports and email them to each manager or will produce a summary spreadsheet that is sent to HR.

Currently because there are around 8000 lines of data, it was the summary option that required the background worker as a long running process time out error was occuring whilst in the main.

What it does is write the data from the list view to an excel sheet and colour co-ordinates the summary rows according to the absense policy. It then copied bottom to top, the summary value the next blank column against all the lines for that individual and then uses this column to decide which sheet to move the row to, copying the row to the new sheet then deleting it from the master list and shifting the cells up.


This works well, but the process of loading the data in to the list view locks up the main thread where it currently runs. I also wanted to make this slightly more complicate as far as threading is concerned, as more of a learning curve than a practical application of the function.

Here is my code so far: [URL]

View 10 Replies

Three Classes Running As Separate Threads?

Nov 21, 2006

I want to have three classes running three simoultaineous threads. I have started out with one class that looks like this:

Imports System.ThreadingPublic Class C_EventCollector Dim oThread As Thread Public Sub New() oThread = New Thread(AddressOf Me.BackgroundProcess) End Sub Private Sub BackgroundProcess() Console.WriteLine(Now.ToString) oThread.Sleep(10000) End SubEnd Class

What I want is execute BackgroundProcess() every tenth second. For testing purpose I print out current date and time to the console. Using this thread BackgroundProcess() only executes once.

View 1 Replies

.net 2.0 Multiple Programs Each Running Threads On Xp, Will .net 2010 Be Better?

Oct 2, 2010

In the past few weeks, to speed up our database freshening process, I've created a couple of extra programs, basically copies of the exe file. The program itself, accesses web pages, images etc and uses threads to do so. The second program uses LIMIT 300,100 and the third LIMIT 600,100, to make sure they don't work on the same records.

Before the last few weeks, one occurrence of the program used to run without problem, from the task scheduler all through the day. Only one occurrence of each exe can run at a time.Since theres now three programs running, .net 2.0, on xp, the program often seems to get stuck and never ends. I have to kill it from task manager.

It runs fine in the IDE I just wonder if there would be any benefit from upgrading to vb.net 2010 ?

View 1 Replies

Multithreading - Code For Running Multiple Threads?

Apr 17, 2010

How to I run multiple threads in VB.NET? Say I need 2 threads - one that prints 100 numbers in a loop and the second one that asks for the user's name and prints it inside a message box.

View 1 Replies

Running Different Processes In Multiple Threads Without Overlapping

Jan 13, 2012

I have a sub-procedure which I want to run a different process, depending on what is currently running. I thought the easiest way to do this was by using an ArrayList of each of the campaign details & adding an 'Inuse' field to check to see if the Inuse field is set to 0 or 1. The problem that I have is that when running the process it is all happening at once & the integer hasn't been changed before the next thread kicks in so my threads are running the same campaigns. I tried to avoid the problem by adding a Thread.Sleep(100) delay inbetween starting threads but this led to exactly the same problem.

Here's an example of what I am trying to do:
Imports System.Threading
Public Class Form1
Private Campaigns As New ArrayList
Private ProcessRunning As Boolean = False
Friend StopProcess As Boolean = False
[Code] .....

View 2 Replies

Running Threads In Thread.Pool Sequential?

May 19, 2012

I have several threads in my WinForm and I am running them via Thread.Pool, what I need to know is that how can I run them sequentially.

example:

Thread1 => me.label1.text = "Thread1"
Thread2 => me.label2.text = "Thread2"
Thread3 => me.label3.text = "Thread3"

In my Form_Load event, I have a line as follows:

[Code]...

View 8 Replies

Execute Multiple Scripts At Same Time, Running On Own Threads?

May 6, 2009

I'm writing a scripter using VBScript, that should be able to execute multiple scripts at same time, running on own threads.
The issue is, I DO start those scripts on different threads, but their sleeps still seem to affect the other threads too.

For example, let's say I start 2 scripts

In the Main event
NewScript1
NewScript2

[code]....

View 1 Replies

Forms :: Working With Threads?

Jan 9, 2010

Public Class ThreadSearch
Inherits frmStDetails 'Windows form which contains my control
Public Event finishedSearching()[code].....

This is the procedure I used to start the thread. It doesn't generates error but the problem is 'IT DOES NOTHING'.

View 9 Replies

Accessing Labels From Different Forms&threads

Feb 5, 2009

Recently i was trying to access the labels of main form (Form1) from a thread that was running on the other form (Form2), and I have noticed, that the label.Text is not changing.Form1 code - after the main Form is loaded I launch the second Formular, and the method on it : [code]There is a sample code attached to show how is it working.Is there any possibility to change the label values on the Main window?Peter.

View 2 Replies

Is Running Multiple Threads Faster Then A Single Thread On A Single Core Cpu

Dec 23, 2009

Say I have a code with 3 methods that do some pretty intensive work. Would executing these methods on 3 seperate threads be faster then executing them one after the other on a single core cpu? And what if it's a dual core or HT?

View 8 Replies

Forms - Sleeping Threads - Just Freeze A Portion Of Code

May 4, 2009

I'm trying to sleep a single thread of code, when i try using System.Threading.Thread, it freezes the whole app, i need it to just freeze a portion of code.

View 11 Replies

Forms :: Threads 'Conversion From String To Type 'Double' Is Not Valid'

Mar 30, 2011

I have a application that writes and reads from a serial port.The com-port is opened elsewhere in the early stages of starting / running frm_Main and is not shown. I have a button1 on my form and when I click it, the module 'RTUValues_Get_IOData' executes perfectly ok, with no errors.[code]However when I call it via a thread [button2], I get the following exception error and it hangs, at the part shown above in RED"Conversion from string "" to type 'Double' is not valid."

View 5 Replies

Find Threads In Application

Jun 7, 2011

I recently began working on an application that was built by someone that is no longer available. This application is filling an excel file, but I can not find ANY code that uses excel. There aren't even any references to excel interops. My thought is that this a multi-threaded application and I can't see what is going on behind the scenes. I tried watching the processes in the task manager, but found nothing.I've never worked with threads before, and do not even know where to begin. Debugging the program with breakpoints at multiple locations does not show me any of these other threads. Anyone have an idea on how to find/debug threads of a program?

View 1 Replies

Vb Application - Maximum No. Of Threads ?

Apr 22, 2010

I know increasing the no . of threads causes risk and many other issues bu i wanted to know what is the maximum no. of threads that my vb application could open..... and is there any way by which i can determine how many threads are currently open in my vb.net application?

View 5 Replies

Application Running Fine On XP But Same Exe Not Running In Vista?

Apr 24, 2010

I had done one application using api which send the message to given number. The working of software is very fine without any error working on windows XP SP2. I heard that vista already contain the .net frame work so didnt installed .net frame work in machine. I checked in vista it shows .net frame work is in machine. But when same code i tried to run on Vista it gives the error. Error is as follows

See the end of this message for details on invoking

just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at SmsSendingApplication.frmSingleMessage.InternetOpenUrl(Int64 hInternetSession, String& lpszUrl, String& lpszHeaders, Int64 dwHeadersLength, Int64 dwFlags, Int64

[Code].....

View 7 Replies

Implement Multiple Threads In Application

May 12, 2010

I need help to implement multiple threads in application.Assume ds.table(0) has 5 and sometime 6 rows rows for i=0 to ds.tables(0).rows.count-1.I have to apply multiple threads, means all five/six rows should start at once using thead and "Process 1" .."Process 4" should also handled by threads.This is hierarchy that I have to apply with threads, how can I do it. It is requested to put piece of code so I can understand better.

View 13 Replies

Multithreading - .NET 4.0 Execute Multiple Threads But Threads Are Completed Before Resuming?

Oct 19, 2011

I just had a new, last-minute idea on to take on a task, so I am running to StackExchange for quick help.

What I want to do is execute a series of methods right in a row, each in their own threads. I want the application to wait until all of these threads are completed, after which the program will resume. It also has to use managed threading (thread pool).

What quick examples could you provide to help me along the way? If it's too complex, what things should I know about so that I can Google it on my own?

View 1 Replies

Queue Threads - Spawn A Series Of 'child' Threads From A Loop

Dec 30, 2009

I have a main thread which is designed to be a batch processor - it spawns a series of 'child' threads from a loop (which can vary in terms of the no of items) - see below

[Code]...

However, each of the 'child' threads could take anywhere from milliseconds to about a minute to process - depending on the complexity of each calculation. There may also be a large number of child threads - e.g 100s. Creating large numbers of child threads is not efficient. I therefore want some way to effectively queue each child thread (and cancel if the process is taking too long to complete). Autoevents seems like one way of doing this, but the only examples I can find seem to assume there are two different processes on seperate threads, not one process being repeated.

View 4 Replies

Use Threading In Application To Put Two Functionality In Two Separate Threads?

May 2, 2009

I have one applicatin developed in my ap i have two main functionalities

1)Copyig Folders & Files from one source to destination

2) And I am showing status of copying in richtextbox and progrss with progress bar

Here i need to use threading bcz i am copying files from one server to another server and some large size files while copying my application always gone to stuck and i am not able to see status of copying and progressbar so how i use threading in my applicatio to put two functionalitis in two seperate threads.

View 4 Replies

VS 2008 - Use Threads In Loop To Make The Application Less CPU-intensive?

May 4, 2009

I am trying to stop the following piece of code from taking up too much processing power of the PC by using threads. But I keep getting errors when I use threads:

[Code]...

View 3 Replies

IDE :: Excluding Forms To Convert A Window Forms Application To Class Library Application

Jan 16, 2012

I am not able to find the Exclude Command in VB 2010 Express. I have no idea which version of Visual Studio it is working with. I've got one 217MB VB 2010 Express file and many 2008 VB Express files with one of them measuring 31 MB. There many other SQL files and .Net Files.

View 4 Replies

The Last Change Wasn't Successfully Persisted.Please Shut Down The Running Application. Sending Message To Designer Failed.Designer May Not Be Running.''?

Jun 4, 2011

what account for this error message in ls beta 2?'' The last change wasn't successfully persisted.Please shot down the running application.

View 1 Replies

.net - Store Application And User Settings Of An Application Running With Multiple Instances?

Jul 12, 2011

Which is the best way to store application and user settings of an application running with multiple instances?My problem is that using the vb's "Application Settings" one instance would overwrite the other one.I want to identify each instance with a number passed via command line argument. I could use this number to identify the appropriate settings of the running instance, but I see in a local INI o XML file a better way to handle that.

View 1 Replies

Running Application Can Know Name Or Other Info Of Desktop-shortcut That Started Application?

Apr 9, 2011

Let's say 10 desktop shortcuts, all with different names/icons, point to and can start the same exe application from the same directory. Is there any means for the application to know the distinct name of the shortcut that was doubled_clicked. Also is there any means for a running application to know if it was started by command line, by a double_click on the exe, by a double_click on a shortcut that points to it, or by another process' call?

View 4 Replies







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