Click here to Skip to main content
15,881,248 members
Home / Discussions / C#
   

C#

 
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!
AnswerRe: Invoke Problem Pin
Luc Pattyn10-Jul-09 0:14
sitebuilderLuc Pattyn10-Jul-09 0:14 
GeneralRe: Invoke Problem Pin
gehbitte10-Jul-09 0:20
gehbitte10-Jul-09 0:20 
GeneralRe: Invoke Problem Pin
gehbitte10-Jul-09 0:28
gehbitte10-Jul-09 0:28 
GeneralRe: Invoke Problem Pin
Luc Pattyn10-Jul-09 0:46
sitebuilderLuc Pattyn10-Jul-09 0:46 
Questioncode to invoke querty keyboard keys in windows applicattion Pin
Vivek Vijayan9-Jul-09 23:52
Vivek Vijayan9-Jul-09 23:52 
AnswerRe: code to invoke querty keyboard keys in windows applicattion Pin
dan!sh 9-Jul-09 23:55
professional dan!sh 9-Jul-09 23:55 
GeneralRe: code to invoke querty keyboard keys in windows applicattion Pin
Vivek Vijayan10-Jul-09 0:15
Vivek Vijayan10-Jul-09 0:15 
GeneralRe: code to invoke querty keyboard keys in windows applicattion Pin
dan!sh 10-Jul-09 0:29
professional dan!sh 10-Jul-09 0:29 
GeneralRe: code to invoke querty keyboard keys in windows applicattion Pin
Mirko198010-Jul-09 1:08
Mirko198010-Jul-09 1:08 
GeneralRe: code to invoke querty keyboard keys in windows applicattion Pin
Vivek Vijayan10-Jul-09 3:08
Vivek Vijayan10-Jul-09 3:08 
GeneralRe: code to invoke querty keyboard keys in windows applicattion Pin
Mirko198010-Jul-09 3:16
Mirko198010-Jul-09 3:16 
GeneralRe: code to invoke querty keyboard keys in windows applicattion Pin
Vivek Vijayan10-Jul-09 21:04
Vivek Vijayan10-Jul-09 21:04 
GeneralRe: code to invoke querty keyboard keys in windows applicattion Pin
Mirko198013-Jul-09 0:15
Mirko198013-Jul-09 0:15 
QuestionAdobe Acrobat PDF link cann't work on windows form Pin
Bhim Prakash Singh9-Jul-09 22:48
Bhim Prakash Singh9-Jul-09 22:48 
AnswerRepost? Pin
Manas Bhardwaj9-Jul-09 22:51
professionalManas Bhardwaj9-Jul-09 22:51 
AnswerRe: Adobe Acrobat PDF link cann't work on windows form Pin
Vasudevan Deepak Kumar10-Jul-09 2:57
Vasudevan Deepak Kumar10-Jul-09 2:57 
Questionadobe acrobat pdf link cann't work on windows form Pin
Bhim Prakash Singh9-Jul-09 22:47
Bhim Prakash Singh9-Jul-09 22:47 

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.