tags:

views:

16

answers:

1

I have to projects in my .net windows forms, in one form(1st Project) i have timer control already running. On some request i want to start that timer from the form1 of (second project).

If we are creating new object in second project for the 1st project(Which is currently in running thread) we will not be able to start the timer for the current instance.

How can we access the current running instance from my 2nd project.

Please suggest me some method

A: 

You are talking about basic interprocess communication. You have two options:

  1. Use named EventWaitHandle object. Create EventWaitHandle instances with the same name in both projects. Set it in on program. In another program, create thread waiting for this event. Make whatever you need (start timer), when this event is set.

  2. Use WCF (standard .NET interprocess communication framework). For your purposes, WCF transport layer should be set to named pipes. Using WCF requires some learning time, just start from beginner WCF tutorial.

Alex Farber