.NETGURU
Microsoft Example Doesn't Work.
Messages   Related Types
This message was discovered on ASPFriends.com 'ngfx-services' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Jim Davis
This article shows the bare bones of a Windows Service:
(http://docs.aspng.com/quickstart/util/srcview.aspx?path=/quickstart/howto/s
amples/Services/ServiceApplication/SimpleService/SimpleService.src&file=VB\S
impleService.vb&font=3)

And on this line:
AddHandler timer.Tick, AddressOf OnTimer
It puts a funny blue line under "Tick" and on mouse over it says that "Tick
is obsolete, Please use Elapsed Event". I then follow the instructions and
change "timer.Tick" to "timer.Elapsed" and then the "OnTimer" in the same
line then says:

Could not find method 'Protected Sub OnTimer(Source AS Obeject, e AS
System.EventArgs)'with the same signature as the delegate 'Delegage Sub
ElapsedEventHandler'(sender AS Object, e AS System.Timers.ElapsedEventArgs)

The rest of the code is exactly as show in the link accept for the minor
changes mentioned above. Can someone help me understand whats up here?

Actually I backed up a moment and found that if I changed the OnTimer Event
to include "Protected Sub OnTimer(ByVal sender As Object, ByVal e As
System.Timers.ElapsedEventArgs)" instead of the default, then no BLUE lines
show up.. dont know why..??

Thanks,

jim d
hy-tech web services
1840 boyscout drive
fort myers fl 33907
941-278-4111 ext.113

Reply to this message...
 
    
Mitch Denny (VIP)
Jim,

OK. It looks like the SDK samples haven't been updated. With
the arrival of BETA 2 of the .NET runtime and Framework a number
of the elements of the framework have been removed, or had some
of their functionality depreciated.

What you are seeing here is a name change. The Microsoft
developers want us to use the Elapsed event instead of
the Tick event. Just as you have already done, you need
to change the assignment of the event handler, and the
signature of the event handler as well.

A firm knowledge of events, delegates and event handlers
and how the interoperate is essential for working with
the .NET Framework, simply because they are used all
over the place (especially once you get into ASP.NET and
Windows Forms).

If you want to learn more about them I would recommend
starting at the Framework SDK:
ms-help://MS.NETFrameworkSDK/cpguidenf/html/cpconevents.htm

Hope this helps.

----------------------------------------
- Mitch Denny
- http://www.warbyte.com
- Click here to reveal e-mail address
- +61 (414) 610-141
-

[Original message clipped]

Reply to this message...
 
 
System.EventArgs
System.Timers.ElapsedEventArgs
System.Timers.ElapsedEventHandler




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification