0

It is now well known how to make interface call to a DLL-implemented COM object in the registration-free environment. The question is the opposite:

How to make interface call from a DLL to a COM object implemented in EXE? Which manifests and which manifest sections should be used?

EDIT: May be it was not quite clear, but I meant in-process call. I want to call an object in the same process, but implemented in EXE rather than in DLL.

EDIT2: OK, I see things goes complicated, so I must explain the original problem. A C++ application implements IApplication interface and keeps pointer to it as a member. This member is returned by a public method accessible from anywhere by means of AfxGetApp().

There is also a mechanism allowing any customer to add his own C# "plugin" DLLs to our application. For such DLLs the IApplication interface is a key access point to the application's features. But these DLLs have no access to the main application's object.

To solve the problem, I added an auxiliary "ICreateApplication" object, which returns the original IApplication pointer. Any "plugin" DLL may create this auxiliary object and obtain from it the required interface. I implemented this object in some arbitrarily chosen DLL, and equipped it with necessary manifests.

This solution works well, but this "arbitrary choice" bothers me. I wonder, is there a possibility to implement "ICreateApplication" in the application object?

Ilia
  • 425
  • 2
  • 10
  • Start reading at [Not every component is a suitable candidate](https://web.archive.org/web/20080915135918/http://msdn.microsoft.com/en-us/magazine/cc188708.aspx) – Hans Passant Nov 23 '15 at 15:31
  • @HansPassant, I'm aware about problems with "EXE" COM servers, but my question was about in-process object. Please see the corrected question. – Ilia Nov 24 '15 at 17:48
  • Your question title sucks serious rocks. It is also completely unclear why the server is not allowed to know anything about the DLL. It loads it so it better know *something* about it. Like an entrypoint to which it can pass an interface pointer so there is no need at all to let COM find the server back.. – Hans Passant Nov 24 '15 at 17:56
  • @HansPassant, You are right, but it was not simple to find a correct "abstract" wording without explaining the whole problem. Please see the second EDIT. – Ilia Nov 24 '15 at 19:44

0 Answers0