Click here to Skip to main content
15,913,084 members
Home / Discussions / C#
   

C#

 
AnswerRe: A simple event that takes no arguments Pin
stancrm10-Jul-09 1:32
stancrm10-Jul-09 1:32 
AnswerRe: A simple event that takes no arguments Pin
Luc Pattyn10-Jul-09 1:58
sitebuilderLuc Pattyn10-Jul-09 1:58 
GeneralRe: A simple event that takes no arguments Pin
Tobias Norlund10-Jul-09 2:17
Tobias Norlund10-Jul-09 2:17 
GeneralRe: A simple event that takes no arguments Pin
Luc Pattyn10-Jul-09 7:40
sitebuilderLuc Pattyn10-Jul-09 7:40 
QuestionXML Post Pin
kibromg10-Jul-09 1:06
kibromg10-Jul-09 1:06 
QuestionHello.. Pin
mjawadkhatri10-Jul-09 1:02
mjawadkhatri10-Jul-09 1:02 
AnswerRe: Hello.. Pin
dan!sh 10-Jul-09 1:05
professional dan!sh 10-Jul-09 1:05 
GeneralRe: Hello.. Pin
mjawadkhatri10-Jul-09 1:08
mjawadkhatri10-Jul-09 1:08 
GeneralRe: Hello.. Pin
J4amieC10-Jul-09 1:15
J4amieC10-Jul-09 1:15 
GeneralRe: Hello.. Pin
mjawadkhatri10-Jul-09 1:23
mjawadkhatri10-Jul-09 1:23 
GeneralRe: Hello.. Pin
Henry Minute10-Jul-09 1:28
Henry Minute10-Jul-09 1:28 
GeneralRe: Hello.. Pin
dan!sh 10-Jul-09 1:18
professional dan!sh 10-Jul-09 1:18 
GeneralRe: Hello.. Pin
Hum Dum10-Jul-09 1:20
Hum Dum10-Jul-09 1:20 
GeneralRe: Hello.. Pin
Vasudevan Deepak Kumar10-Jul-09 2:02
Vasudevan Deepak Kumar10-Jul-09 2:02 
QuestionGenerics and Arrays Help Please! Pin
James612810-Jul-09 0:49
James612810-Jul-09 0:49 
AnswerRe: Generics and Arrays Help Please! Pin
DoctorMick10-Jul-09 0:55
DoctorMick10-Jul-09 0:55 
GeneralRe: Generics and Arrays Help Please! Pin
James612810-Jul-09 1:16
James612810-Jul-09 1:16 
Questionhow do i use sendkeys.send Pin
Vivek Vijayan10-Jul-09 0:45
Vivek Vijayan10-Jul-09 0:45 
AnswerRe: how do i use sendkeys.send Pin
dan!sh 10-Jul-09 1:00
professional dan!sh 10-Jul-09 1:00 
QuestionPlace cursor at the end of combo box text Pin
pp.p10-Jul-09 0:35
pp.p10-Jul-09 0:35 
AnswerRe: Place cursor at the end of combo box text Pin
Nagy Vilmos10-Jul-09 0:43
professionalNagy Vilmos10-Jul-09 0:43 
QuestionSOAP Messages - Intercepting and redirecting the HTTP call to a remoting server Pin
MrEyes10-Jul-09 0:21
MrEyes10-Jul-09 0:21 
AnswerRe: SOAP Messages - Intercepting and redirecting the HTTP call to a remoting server Pin
Member 440849712-Jan-10 2:02
Member 440849712-Jan-10 2:02 
QuestionHow to find specific HtmlElement on a web page if we know some (X, Y) co-ordinates on the IE window? Pin
svt gdwl10-Jul-09 0:17
svt gdwl10-Jul-09 0:17 
QuestionInvoke Problem Pin
gehbitte9-Jul-09 23:56
gehbitte9-Jul-09 23:56 
Hello everybody,

i've got this problem:

I create a new Windows Form (BuyWindow.cs) out of the static class Program.cs which shows me a financial chart. I am using a API from a Data Provider (Taipan Realtime) to create Streams which deliver the actual price information for my security. This Streams I also create in the Program.cs:

private static BuyWindow f;
internal static void testwindow()
        {
            if (Tapp == null) { Tapp = new TaiPanRTLib.TaiPanRealtime(); }
                         
            f.build_chart();
          
            f.Show();           

            DataStream TPStream;
            TPStream = (DataStream)Program.Tapp.DataStream;
            TPStream.Add(17956195, 1);
            TPStream.Brief += new _IDataStreamEvents_BriefEventHandler(TPStream_BriefBuyWindow);
            TPStream.Geld += new _IDataStreamEvents_GeldEventHandler(TPStream_GeldBuyWindow);
           
        }
        static void TPStream_GeldBuyWindow(int SymbolNr, float Kurs, float Volume, DateTime Zeit)
        {
            f.update_bid(Zeit, Kurs, false);          
        }
        static void TPStream_BriefBuyWindow(int SymbolNr, float GeldKurs, float Volume, DateTime Zeit_kurs)
        {
            f.update_ask(Zeit_kurs, GeldKurs, false);                   
        }


As you can see, I create the Events TPStream_GeldBuyWindow, TPStream_BriefBuyWindow which are triggered every time a new price exists on the Stock Exchange.

In the BuyWindow.cs there is the Code which updates the Form with the respective price(s):

public void update_bid(DateTime bid_time, float price, bool build)
        {            
                if (this.InvokeRequired)
                {
                    this.Invoke(delegateUpdateBid, new object[] { bid_time, price, build });
                }
                else
                {                  
                    bidseries1.Points.AddXY(bid_time, price);                   
                    if (!build)
                    {
                        current_bid = price;
                        update_label(price.ToString(), "label9");                        
                    }
                }
            }
         }



And here's the Problem: The Price is updated just one SINGLE time. That means, the first price after creating the chart and showing the BuyWindow is delivered and shown on the BuyWindow form. But then, the Stream Events in the Program.cs class are never updated again although there are new prices available.

I found out, if I outcomment the f.updatexxx line(s), the Streams work as intended. Every time a new price is settled on the Exchange, the Events are triggered.

So it seems that the Invoke method somehow causes the Program.cs to loose connections with the Stream Events or whatever.

I hope I described the problem good enough Smile | :) Any hints would be appreciated!

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.