Solved

Mixing in-process and out-of-process COM servers

Posted on 2013-11-21
7
243 Views
Last Modified: 2013-12-17
Hi all. Please tell me if this is possible. I want to create an executable (I'll call it HostExe) that will be used by other executables to obtain some COM interfaces. The COM interfaces will be built as we need them and thus I would like the interfaces to be inside a DLL. I would then like to have my HostExe 'see' the DLLs (look in a particular folder) and then load the dlls into the HostExeaddress space. Then the other executables would get the interface (object) from the HostExe. Is this possible? (I'm not sure it is even clear non-the-less possible :) ). If it is possible, can you give me example (psuedo code is fine) code? Or send me to an article/document?


Thanks, Brian
0
Comment
Question by:BrianDumas
  • 2
  • 2
7 Comments
 

Author Comment

by:BrianDumas
ID: 39667332
Another bit of information. I don't want to recompile the HostExe each time a  new interface comes out. I would like it to be dynamic. That is, I would like the HostExe to realize that there is a new DLL, load it, and register the interface as if the HostExe is the owner.
0
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 39667490
This should be possible - just the DLLs that implement the interfaces strictly speaking are not COM DLLs (i.e. no 'DllRegisterServer()' etc.), but plain Windows DLLs, the only hold the code.  So, basically the executable loads the DLL, the DLL provides some entry points that e.g. get the CLSID they implement, return an interface pointer, and all the stuff you need. Well, you could also add  'DllRegisterServer()' if you want them to be able to act standalone. If they are just not registered with COM and allow the executable to obtain the required information, that should work.
0
 

Author Comment

by:BrianDumas
ID: 39668786
Thanks jkr. I'll check this out and come back with either more questions or to accept the solution.
0
 
LVL 59

Expert Comment

by:LeeTutor
ID: 39721509
I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.
0
 
LVL 86

Expert Comment

by:jkr
ID: 39721510
Since "Delete" is the only option that LeeTutor knows in the cleanup process, that would be reason enough to object. Yet I have to add that "Not enough information to confirm an answer." simply is incorrect, even when stated by a non-programmer. Thus, I object.
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When you try to share a printer , you may receive one of the following error messages. Error message when you use the Add Printer Wizard to share a printer: Windows could not share your printer. Operation could not be completed (Error 0x000006…
A quick guide on how to use Group Policy to create a custom power plan and set it active on Windows 7.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question