1

I have this situation over here, where I have placed the application I've developed in the windows Startup folder. I'm launching it every time the PC is started. But then how do I get the LyncClient at that instance? Because my application is being launched before Lync has been started. So basically my application will not start because whenever it comes to this line, var getclient = LyncClient.GetClient();, it will prompt an error, the host process is not running.

Is there a way for me to keep waiting until LyncClient.GetClient() is not null? And then continue executing my codes once i know that lync is running?

Zenvo
  • 83
  • 2
  • 10

1 Answers1

0

Sorry if I have wasted anyone's time, but I have decided to go with this workaround, which is not really that good, but I thought that I should share it anyway.

    Process[] pname = Process.GetProcessesByName("communicator");
    while (pname.Length == 0) 
    {
        pname = Process.GetProcessesByName("communicator");
    }
    var getclient = LyncClient.GetClient();

Hopefully someone has a better solution than this.

Zenvo
  • 83
  • 2
  • 10