• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 704
  • Last Modified:

Connection points in ATL/COM

Hi experts,
                        How can we implement connection points COM. I have gone through some www.Codeproject.com articles about connection points but I not able to implement a sample app for connection points.I am using visual c++ 2008 IDE. I want to set a funtion from client app to the COM server and COM have to callback this function.

Regrads,
Vimal
0
vimalalex
Asked:
vimalalex
  • 5
  • 3
1 Solution
 
Deepu AbrahamR & D Engineering ManagerCommented:
Hi Vimal,

Did you read this already?

http://www.codeproject.com/KB/COM/connectionpoint.aspx

0
 
vimalalexAuthor Commented:
Hi DeepuAbrahamK,
                 
                  Yes I have gone throught the above article.There they are  creating  a CSink class in client app for setting the callback function.Is there any method that we can directly give some function names.
Can you pease explain me the proper steps for implementing connection points is it necessary to implement a class in client side.

Regards,
Vimal.
0
 
ambienceCommented:
What have you done so far and what are the results/errors?

Are you using an INPROC server?
0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
vimalalexAuthor Commented:
Hi ambience,

                      Thanks for your reply.I am using INPROC server.I have done a COM server dll which has a TestShow() function in the connection point class and Fire_TestShow() function in proxy class. How I can use this function in the client applicatioin.Do I need to implement any extra class in client application for setting the callback function TestShow().

Regards,
Vimal.
0
 
ambienceCommented:
Yes you need to implement the Even Sink interface on a COM object in your client app. Further, after creating the server object you must fetch IConnectionPoint interface (query Interface) and do Advise() and pass it the interface of your sink object.

Check this out too http://msdn.microsoft.com/en-us/library/ms678815%28v=vs.85%29.aspx.

If you can paste the code where you create the server etc. then someone should be able to help easily.
0
 
vimalalexAuthor Commented:
Hi ambience,

               Is there any easy way to create sink interface ie I mean any wizard or manually we need to type the entire code for sink inteface.

Regards,
Vimal.
0
 
ambienceCommented:
The sink interface will be defined by the server and would reside in a .tlb.

On the client side, you will have to import the tlb/dll.

After that you can create a regular MFC or ATL based object (using wizard I guess) that implements the interface. Or if you have an object already then just implement another interface on it.
0
 
vimalalexAuthor Commented:
Hi ambience,
                       
                    Thanks for your reply. I have implemented a COM Server and it is registered in my machine and it  has a CLSID{....}.
Normally in a client app we will create the  instance of the COM using the CLSID and we will use the interface pointer to invoke the COM methods.For implementing Connection point sink class as your above comment
"On the client side, you will have to import the tlb/dll.
After that you can create a regular MFC or ATL based object (using wizard I guess) that implements the interface."

Using which wizard in MFC application can I create a sink cass automatically.Please explain some more detail.

Regards,
vimal.
0
 
vimalalexAuthor Commented:
Hi ambience,

           Please reply for my last comment, if possible. I am not getting any response so I am closing the question
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now