Your second parameter in the client_CurrentTime method is of type
DateTime - If you've worked much with Windows or Web forms or any
other types of events, this should stick out like a sore thumb - the
second parameter of an event handler is typically of type EventArgs
(or a descendent) - I'm assuming this should be of type
CurrentTimeEventArgs, not of type DateTime.

On Oct 26, 2:53 pm, Dickery1 <[EMAIL PROTECTED]> wrote:
> here is my pience of code. i am not sure where i made error in the
> overloading of the deletgate client_CurrentTime.
> i get error Error       No overload for 'client_CurrentTime' matches elegate
> 'System.EventHandler<Krs.Ats.IBNet.CurrentTimeEventArgs>' C:\Temp
> \ttTraderTestApp\Program.cs
> static void Main(string[] args)
>         {
>             client = new IBClient();
>             Console.WriteLine("Connecting to IB.");
>             client.CurrentTime += client_CurrentTime;
>
>             client.Connect("127.0.0.1", 7496, 0);
>             while (true)
>             {
>                 Thread.Sleep(100);
>             }
>
>         }
>         static void client_CurrentTime(object sender, DateTime e)
>         {
>             Console.WriteLine("the current time is " + e.ToString());
>         }
>
> the currentTimeEventARgs is defined as below.
> namespace Krs.Ats.IBNet
> {
>     /// <summary>
>     /// Current Time Event Arguments
>     /// </summary>
>     [Serializable()]
>     public class CurrentTimeEventArgs : EventArgs
>     {
>         private readonly DateTime time;
>
>         /// <summary>
>         /// Full Constructor
>         /// </summary>
>         /// <param name="time">Current system time on the server side</
> param>
>         public CurrentTimeEventArgs(DateTime time)
>         {
>             this.time = time;
>         }
>
>         /// <summary>
>         /// Current system time on the server side in UTC
>         /// </summary>
>         public DateTime Time
>         {
>             get { return time; }
>         }
>     }
>
> }
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web 
Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/DotNetDevelopment

You may subscribe to group Feeds using a RSS Feed Reader to stay upto date 
using following url  

<a href="http://feeds.feedburner.com/DotNetDevelopment";> 
http://feeds.feedburner.com/DotNetDevelopment</a>
-~----------~----~----~----~------~----~------~--~---

Reply via email to