Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need help from you in creating a small application.

I have a windows service. I need to create com wrapper for windows service.

Actually my requirement is I have a client application in VB. When the client sends a request to the wrapper it should process request to the service and
send the response back to client. Can you please send me any sample application or any idea how to proceed?
Posted

1 solution

In the project properties, under advance compile options, mark the checkbox to register the component for COM Interop. That will create a COM wrapper with the proper register and unregister entry points in the target assembly. Then, just reference the assembly as any other COM component in your VB app.
 
Share this answer
 
Comments
pdmkosireddi 19-Jan-12 1:13am    
Hi Jason, this works for class library but I need for windows service. I need to create com wrapper for windows service. Could you please suggest?
Jason Gleim 19-Jan-12 8:52am    
I'm assuming you wish to communicate with the service while it is running... you can't do that by just linking against a COM object. You would have to use some method of inter-process communication like named pipes or a socket or something. You could create a class library wrapped for COM that handled the interaction with the service then link against and call into that class.

If you look at services that have a UI component to them, they are done in this manner. The UI part is separate from the service and communicates with it for the interaction. You have to do this because the UI part must be able to spin up/down independent of the service.

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