dataset

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can someone help me please - have been stuck on this for days no

I'm using an api, which sends event frequently to my application
I store the objects sent in a datatable, and then use a forms timer - to perform some calcuations on this cache and then to update the data table in the datset that is displyed

The update datatable for the form is surrounded with a begin load data end load data/ there is an application do events after the iteration through the datatable
The problem is each time I call this update method, I sop getting any new messaeges from the api. It seems like this must be a threading issue - but I only have one thread in the application and as dar as I can tell the forms timer runs on the same thread

Any help would be greatly appreciated

I also cakk the datatable accept changes after the updates and also invalidate the datagrid so it should get redrawn - this is all ended with an application do events - but still the application halts and nothing further happens - no more message
 
Don't you *ever* get any more messages?
Or is it just during the call to Update that you don't get any?

The second case is not that strange. You only have one thread
so only one thing can be done at a time. The thread is busy
running your Update method so it can't dispatch messages
(and yes, the forms timer runs on the same thread).

The solution is to move your call to Update into a new thread
You'll also need to synchronize access to your shared data between
this new thread and the main thread, so that both don't write to it
at the same time

/claes


kiran said:
Can someone help me please - have been stuck on this for days now

I'm using an api, which sends event frequently to my application.
I store the objects sent in a datatable, and then use a forms timer - to
perform some calcuations on this cache and then to update the data table in
the datset that is displyed.
The update datatable for the form is surrounded with a begin load data end
load data/ there is an application do events after the iteration through the
datatable.
The problem is each time I call this update method, I sop getting any new
messaeges from the api. It seems like this must be a threading issue - but
I only have one thread in the application and as dar as I can tell the forms
timer runs on the same thread?
Any help would be greatly appreciated.

I also cakk the datatable accept changes after the updates and also
invalidate the datagrid so it should get redrawn - this is all ended with an
application do events - but still the application halts and nothing further
happens - no more messages
 
I cant move the call to update into a new thread as the thread that updates the form controls should be the main thread. I have however moved the calculations into a new thread

The problem is still that I dont any more messages - or if I do they are really slow - with messages in the middle missing
I figured that messages should be queued and pumped through when the rhread is free - but this is not happening

Thank you
 
kiran said:
I cant move the call to update into a new thread as the thread that
updates the form controls should be the main thread. I have however moved
the calculations into a new thread.

Good enough

The problem is still that I dont any more messages - or if I do they are
really slow - with messages in the middle missing.
I figured that messages should be queued and pumped through when the
rhread is free - but this is not happening.

This sounds weird. They should indeed be queued and processed later when the
thread becomes available again
Hard to tell what the problem is without seeing the actual code. Try to
reproduce it in a small sample and post it here

/claes
 
Back
Top