473,657 Members | 2,652 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Threading an Event raising

Hi out there,

I have a little problem with threading an event receiving.
I have a custom Class (DLL) that raises Events. When I run
the Instance without threading it works fine.

When I do threading no Events are received.

Code:

Private WithEvents objDataCollect As
PPTR.PPTHandlin g.DataCollect97
[...]
Dim objThreadDataCo llection As Thread
objDataCollect = New PPTR.PPTHandlin g.DataCollect97

objThreadDataCo llection = New Thread(New ThreadStart
(AddressOf objDataCollect. startDataCollec tion))
objThreadDataCo llection.Apartm entState = ApartmentState. STA

objThreadDataCo llection.Start( )

And Events look like this:
Private Sub objDataCollect_ EvError(ByVal intStatusCode
As Integer, ByVal strSysMessage As String) Handles
objDataCollect. EvError
'hier den Fehler behandeln...
End Sub

What do I have to do to receive the Events.

Thanx alot and merry christmas.
BenLeino
Nov 20 '05 #1
0 982

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

Similar topics

6
2864
by: Dan | last post by:
I've created a pocketpc app which has a startup form containing a listview. The form creates an object which in turn creates a System.Threading.Timer. It keeps track of the Timer state using a TimerState object similar to the example in the System.Threading.Timer documentation. The method which handles the timer events, among other things, periodically calls a method in this TimerState object which raises an event to the startup form,...
4
333
by: Glenn Dekhayser | last post by:
Weird question, hopefully someone out there can help. I am basically iterating through a list of files, using QueueUserWorkItem to spawn a thread to process each file. I am using a wrapper class around the processing logic as a way to set parameters for the logic. So I do the QueueUserWorkItem and the processing goes on its merry way.
3
2540
by: Chris Dunaway | last post by:
Consider the following simple classes/interfaces defined below. When the derived class raises the events, on which thread is the event code run? Do I need to do anything to catch the events in my main app? What threading issues do I have if several of these fileproc classes are instantiated and run at the same time? '*** BEGIN CODE Public Interface IFileProc ReadOnly Property FileMask() As String Function Process(ByVal filename As...
1
1356
by: Brad Brening | last post by:
I am building a class that has a function that I would like to run asycronously. When the function is complete I would like to notify the calling thread by raising an event or using a delegate. The handler for the event (or the delegate callback) should run in the parent thread - not on the asyncronous thread created while the function ran. So, basically, I want my parent (form, class, control) to call my class function - which spawns a...
8
1268
by: mmitchell | last post by:
I have a thread that does periodic database maintenance. While this process is going on I would like the rest of the application to hold off on accessing the database. I thought I could share a property in a class to hold the status, but that doesn't seem to work. Any ideas on what the best way for me to determine when the thread is doing it's work? Thanks Mike
1
994
by: Paul Cheetham | last post by:
Hi, I have a thread in my application that is listening to the Serial port using GetCommEvents. When something is received, it generates an event, and then goes back to waiting for more data. - I am using this for a swipe card reader. When a card is swiped, an event is generated, and I log the user into my application. The card reader is no longer required at this point so I disable it, which kills off the thread.
4
1536
by: sloan | last post by:
I"m trying to figure out what concept I'm missing here, or if its not a good idea .. or what. Here is my example.. code is below. I have an employee class. It has an event that can be raised. In the constructor, I check the to see if the employees birthday is today. If it is today, then I raise an event.
1
1450
by: Ajak | last post by:
Hi all, I would like to write a class (Task) with a method to do some lengthy process based on several of the class properties. The method is running on different thread. During the execution of the method, the class is suppose to fire events such as ProgressChanged. And it raises Completed and Failed event on completion and error
5
6587
by: FP | last post by:
Hi, i'm currently developing a class to communicate with a serial device,using the SerialPort component. Basically,the main application will interact with this class through its method "Call",the class itself will handle all the details of a call (AT commands included). My problem is that i dont want the application to hang while i'm interacting with the modem,so i have started to learn about threading. Many people have suggested me to...
0
8392
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8305
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
7324
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
6163
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
5632
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
4151
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1953
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1611
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.