I have an exe file. This is a program ,that starts when windows start up. It is running in background and is visible in system tray. I have another program, that I want to connect to the first one.
I added an atl simple object to the project, added an interface and a function and recompiled it. The name of atl object is SessionManager.
I added these two lines in second prorgram:
ISessionManager * pSessionManager;
HRESULT hr = CoCreateInstance(CLSID_SessionManager, NULL, CLSCTX_ALL, IID_ISessionManager, (void**)&pSessionManager);
When first program is running, second program throws error hr = -2147467262: E_NOINTERFACE
When first program is not running, second program throws error I get hr = -2147221164: class not registered.
So I guess that second program can detect the first one, but for some reason it can not use it.
Can you help me?