-
ATL COM Question
How do I keep my programming running once it has started? I have my "WinMain" which was automatically implemented for me, but I "overrode" the Run function so that I could add another call within it.
Code:
class CTestModule
{
public:
// Override CAtlExeModuleT members
HRESULT Run(int nShowCmd = SW_HIDE)
{
DoSomething();
__super::Run(nShowCmd);
}
};
My program runs when called, but then disappears once the calling program leaves. I need my program to stay running so that it maintains state in-between new applications making calls to it.
I tried to put a "while (true)" loop around Run, but that doesn't seem like the correct way to keep it running.
Thanks in advance! Any help is greatly appreciated.
-
Re: ATL COM Question
Man, just stop mutilate your server. COM server life time is unexceptionally governed by reference counting mechanism.
_Module::Lock() is all you need.
-
Re: ATL COM Question
Thanks - I added this to my code and it seems to have resolved my issue.