locked
Call c# Windows Service from c++ RRS feed

  • Question

  • I have created a windows Service using c#. I need to access the Windows service from my C++ application .Please suggest me with some ideas or examples.
    Wednesday, June 24, 2015 7:16 AM

Answers

  • At all if you want to communicate between a windows service and a normal (GUI) application in the current user context you should use IPC mechanisms:

    https://msdn.microsoft.com/en-us/library/windows/desktop/aa365574(v=vs.85).aspx

    Choose the mechanism you like most and than you implement the communication in the service and your application.


    Best regards

    Bordon

    Note: Posted code pieces may not have a good programming style and may not perfect. It is also possible that they do not work in all situations. Code pieces are only indended to explain something particualar.

    • Proposed as answer by Shu 2017 Friday, June 26, 2015 7:27 AM
    • Marked as answer by Shu 2017 Thursday, July 2, 2015 3:20 AM
    Wednesday, June 24, 2015 10:34 AM

All replies

  • Wednesday, June 24, 2015 8:19 AM
  • Thanks Pradish for your example.

    I have added some properties in Windows Service . I would like to get the value of the property from Windows service in C++ Application. How to do this..

    Wednesday, June 24, 2015 9:52 AM
  • At all if you want to communicate between a windows service and a normal (GUI) application in the current user context you should use IPC mechanisms:

    https://msdn.microsoft.com/en-us/library/windows/desktop/aa365574(v=vs.85).aspx

    Choose the mechanism you like most and than you implement the communication in the service and your application.


    Best regards

    Bordon

    Note: Posted code pieces may not have a good programming style and may not perfect. It is also possible that they do not work in all situations. Code pieces are only indended to explain something particualar.

    • Proposed as answer by Shu 2017 Friday, June 26, 2015 7:27 AM
    • Marked as answer by Shu 2017 Thursday, July 2, 2015 3:20 AM
    Wednesday, June 24, 2015 10:34 AM
  • Maybe another alternative is added another layer in C# in client code & interact with your C++ code?

    Steve

    Wednesday, June 24, 2015 2:52 PM