Click here to Skip to main content
15,884,936 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
i have need to use com objects for the inter process communication purpose.

In my project i have created

a c++ dll,

a c++/cli interface for using that dll in c#

and my project is being developed in c#

now i need to use com objects(for inter process communication purpose in windows system) but i am not sure how i can use them with my existing project model.

i am learning how to create com objects and all, but having difficulty understanding how can i use them with my existing project model, all the sources i found seems to suggest how to create a new com object and then use it etc.

to further clarify my question : i want to use com interface with my existing c# project instead of creating a new project from beginning.

do i need to modify my project or any other ideas are appreciated.

i am new to com objects and learning it now.
Posted
Comments
Richard MacCutchan 7-Aug-15 4:14am    
Exactly what problem are you trying to solve? Why did you create the C++ DLL in the first place?
RajneeshSaysHello 7-Aug-15 4:25am    
i created the c++ dll because i need to use the speed and flexibility of low level interface provided by c/c++ language.

can i register my whole project(with given project module) with using com objects or something like that.
Afzaal Ahmad Zeeshan 7-Aug-15 4:40am    
If speed is what you are looking for, then try to stick with C++ only. Why are you merging every platform available in your project? Visual C++ would be what you are looking for here.

As to your second line, everything is possible. It depends on how you go for it.
RajneeshSaysHello 7-Aug-15 6:57am    
thanks
Richard MacCutchan 7-Aug-15 5:06am    
See https://www.google.com/search?q=COM+in+c%23, for some samples and tutorials on using COM objects from C#. Get rid of the C++/CLI interface, it just complicates things.

1 solution

It will be clearer if you get rid of the cli-stuff and only use a C++ which gets called from C#.

It is quite simple possible, as I wrote an article and demo code about it.Also this article is worth reading even it is the opposite way, if you consider modiying your com.

Create your com-objects as global object pointers.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900