views:

236

answers:

1

hi all,

I'm facing the following configuration: IE loads c++ activeX (LOADER application that loads c# COM ActiveX (EXECUTOR) that using reflection starts c# UI application (the main application) that uses some legacy c++ COM dlls.

I'm trying to avoid registration of these legacy c++ COM (I want to use manifest). But with no success.

If there is a way to specify manifest for the ActiveX with the "file" section that points to these dlls?

I tried to created manifest for IE with no success, putting Native.manifest in the directory where the legacy located, also - no success.

It seems that XBAP instead of loader and executor should solve the problem. But, any ideas how to solve the problem in the current architecture?

thanks

+1  A: 

You don't own IE so you shouldn't be creating a manifest for it. If you're going to put COM registration data into a manifest, you're going to have to tell the system to look into that manifest for the registration data. Since you don't control the host application, the way to do that is to use the Activation Context APIs, notably CreateActCtx pointing to the correct manifest, followed by ActivateActCtx on that thread. You can then CoCreateInstance what you wish, and follow it with a DeactivateActCtx/ReleaseActCtx.

The reason why an XBAP might be working for you is that since it's a separate executable, the manifest is automatically activated by the system and tied to your XBAP process on process start. When you're hosting inside IE you have to do more work since you don't control the process.

Eugene Talagrand