How to debug IB Controller

How do I debug the IB Controller

i have the IBControler Source code to My Visual Studio 2017

and I open the IBController in debug mode ...

I Open Amibroker and open a formula editor to debug mode

i first time to run the formula

ib = GetTradingInterface("IB");

it will be ruturn the ib immediately

and i stop the debuger

i run again the formula debuger in second time

ib = GetTradingInterface("IB");

it will be return the ib is NULL and very slow

What happened, how to solve it