Equivalent to Application.EnableEvents in C#

S

SLL

Hi all-

I am a fairly skilled VBA programmer but only have limited C#
programming experience. I am currently working on a C# project which
is connected to a live/real time data feed. When data changes, my
code exectues, and certain events are raised based on the new data.

My issue right now is that the data is often coming in so fast, that
at times, i dont think all of my code is exectuting.

IE.

New data, call it X, arrives...so i call "public void NewData(X)"

in NewData, i perform some calculations and call other functions at
the end, say A, B and C. I am not positive, but I dont think that I
get to call function C every single time, because the new data
refreshes before it is finished.

Is this possible?

In VBA, I would use "application.enableevents = false" in order to get
passed this issue...is there an equivalent in C#?

Thanks in advance.

-SLL
 
A

Anthony Jones

SLL said:
Hi all-

I am a fairly skilled VBA programmer but only have limited C#
programming experience. I am currently working on a C# project which
is connected to a live/real time data feed. When data changes, my
code exectues, and certain events are raised based on the new data.

My issue right now is that the data is often coming in so fast, that
at times, i dont think all of my code is exectuting.

IE.

New data, call it X, arrives...so i call "public void NewData(X)"

in NewData, i perform some calculations and call other functions at
the end, say A, B and C. I am not positive, but I dont think that I
get to call function C every single time, because the new data
refreshes before it is finished.

Is this possible?

In VBA, I would use "application.enableevents = false" in order to get
passed this issue...is there an equivalent in C#?

No. but you'd have to show us some of your code so we can understand what
you understand an 'event' actually is. Unless you have some wierd bit of
code a simple function like:-

void NewData(sometype X)
{
A(X);
B(X);
C(X);
}


C will always be reached unless there is an exception.

Could there be an exception that your code is at some point ignoring? We
need relevant snippets of your code.

I suspect the real answer is that a new call to NewData is occuring on
another thread before a previous call has completed both will be running at
the same time. What is the 'data feed'? We just need more info to be able
to help you.
 
S

SLL

No.  but you'd have to show us some of your code so we can understand what
you understand an 'event' actually is.  Unless you have some wierd bit of
code a simple function like:-

void NewData(sometype X)
{
    A(X);
    B(X);
    C(X);

}

C will always be reached unless there is an exception.

Could there be an exception that your code is at some point ignoring?  We
need relevant snippets of your code.

I suspect the real answer is that a new call to NewData is occuring on
another thread before a previous call has completed both will be running at
the same time.  What is the 'data feed'?  We just need more info to be able
to help you.

thanks for the response...

The data is real time market data, and I am working in milliseconds.
Basically the way it works, is if any new data becomes available, it
automatically calls NewData(). I then think that it should be
performing the functions within NewData. The functions are not actual
function calls outside of NewData, but are built into the API that I
am working with (ie. send or change an order price or quantity).

Does this make more sense? I can provide additional information if
needed. I would prefer to steer clear of posting the actual code on a
public group board, but would be willing to have a personal
discussion.

Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top