Link to home
Start Free TrialLog in
Avatar of cimcto

asked on

Start timer in DLL

Ok...I have created a DLL that does some communications with devices.  My problem is that I need to start a timer that I have on a hidden form in the DLL when my external program creates a new instances of the DLL.  How can you do that?
Avatar of Kalpesh Chhatrala
Kalpesh Chhatrala
Flag of India image

Create Hidden Form Object and start Timer in Form Constructor.
Avatar of Deepu Sreedhar
Deepu Sreedhar
Flag of Ireland image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Whenever you want to use it ...
AddHandler TSTimer.Elapsed, AddressOf TSTimer_Tick
TSTimer.Enabled = True

Open in new window

Avatar of cimcto


I think I asked the question wrong.  I need to start the timer that is on a hidden form in my DLL project from a call that I make to the DLL from my Application that is talking to the DLL.
Add a custom constructor to the class that needs to start the timer, something like the following:
Public Class Class1

	Public Sub New()

		Dim frm As New Form1

	End Sub

End Class

Open in new window

Avatar of cimcto


This got me pointed in the right direction and I figured it out from there.