Dim instance As New Timer
I get the error: Error 1 Overload resolution failed because no accessible
'New' accepts this number of arguments.
Yet, in the help section for Timer (in VB 2005) this is exactly the syntax
shown. I also tried:
Dim instance As Timer = New Timer
and that gives the same error.
--
Anil Gupte
www.keeninc.net
www.icinema.com
www.wizo.tv
I think you're referring to System.Threading.Timer, hence you get the
error because Timer object under System.Threading doesn't accept empty
constructor, see constructor overload list here:
http://msdn.microsoft.com/en-us/library/system.threading.timer.timer(VS.80).aspx
If you want to instantiate System.Timers.Timer, you can use it with
empty constructor to initialize Timer object:
Dim instance As New System.Timers.Timer
http://msdn.microsoft.com/en-us/library/system.timers.timer.timer.aspx
Hope this helps,
Onur Güzel
Which kind of Timer? There is not only one.
- System.Windows.Forms.Timer
- System.Timers.Timer
- System.Threading.Timer
If you use the latter one, it does not have a parameterless concstructor,
which explains the error message. Import another namespace or use the full
qualified name to specify one of the other timers. If they are not
available, ouy ahve to set a reference to the containing assembly.
Armin
--
Anil Gupte
www.keeninc.net
www.icinema.com
www.wizo.tv
"Armin Zingler" <az.n...@freenet.de> wrote in message
news:%23WD6pLS...@TK2MSFTNGP06.phx.gbl...
Thanx,
--
Anil Gupte
www.keeninc.net
www.icinema.com
www.wizo.tv
"kimiraikkonen" <kimirai...@gmail.com> wrote in message
news:a3ed2d79-32e7-43db...@s50g2000hsb.googlegroups.com...
As long as it is not for a service or to be used in an extra thread use the
System.Forms.Timer, that is simple the best but does not work in the above
situations
Cor
"Anil Gupte/iCinema.com" <anil...@icinema.com> schreef in bericht
news:u5keFOWL...@TK2MSFTNGP04.phx.gbl...
Name your variable something besides "instance." Try TicToc or Timer1.
FYI: You can't name your variable int, string, class, or return either.
Understand?
Dim instance As String
Dim instance As Timer
Dim instance As System.Timers.Timer
--
Anil Gupte
www.keeninc.net
www.icinema.com
www.wizo.tv
"jp2msft" <jp2...@discussions.microsoft.com> wrote in message
news:A42E0623-5A1C-4D33...@microsoft.com...
I do not develop in VB.
--
Anil Gupte
www.keeninc.net
www.icinema.com
www.wizo.tv
"jp2msft" <jp2...@discussions.microsoft.com> wrote in message
news:A62249B7-4F36-42CD...@microsoft.com...
But it seems that you don't read the answers you get. Are you sure you are
creating a Service or somthing like that.
As I wrote earlier in this thread, the System.Timers.Timer is only for
Services or thinks like that.
Normally there is a better one for this. (There are 3 timers available)
Cor
"Anil Gupte/iCinema.com" <anil...@icinema.com> wrote in message
news:OzAbgqvL...@TK2MSFTNGP06.phx.gbl...
Thanx,
--
Anil Gupte
www.keeninc.net
www.icinema.com
www.wizo.tv
"Cor Ligthert[MVP]" <Notmyfi...@planet.nl> wrote in message
news:%239st$m6LJH...@TK2MSFTNGP05.phx.gbl...