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.