|
-
March 27th, 2007, 03:10 PM
#1
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.
-
March 27th, 2007, 03:22 PM
#2
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.
Last edited by Igor Vartanov; March 27th, 2007 at 03:31 PM.
Best regards,
Igor
-
March 27th, 2007, 03:42 PM
#3
Re: ATL COM Question
Thanks - I added this to my code and it seems to have resolved my issue.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|