“CoRegisterSurrogateEx continued: Tomas c…”

1 minute read

CoRegisterSurrogateEx continued: Tomas comments here in the blog: "Let me see if I get one thing straight: You say we should _enable_ the application when the host starts up and _disable_ it when it shuts down, right?"   --- Yes, exactly. "While we're on it, I think in many cases it would just be enough (and easier, up to a point), to simply make the application components fail activation if they're not running inside your custom surrogate.... what do you think?" -- That would be a good safeguard to avoid failures causes by an incorrect "activation environment". Still, throwing exceptions at activation time is a good indicator that something is wrong, but it won't help you spinning up a working host. Also, once a "wong host" is running, you'll have problems getting the custom host to run properly. Therefore, disabling or "run as NT services" is the better idea Summary: You can host COM+ server applications in a custom host process, with all features. In fact, the host process doesn't need to be fully dedicated to hosting the COM+ app. You just need to spin up one thread for CoRegisterSurrogateEx (which in turn will spawn all thread required for the COM+ app), while other threads can do other things.  


Leave a Comment