none
How to fire events across different process

    Question

  • Hi,

    In C#.Net how to fire events across different processes. I have two processes running and I want to fire event from first processes to second processes. Both Processes are creating the same component instance i.e. Component - C1

    First Process - P1 Second Process - P2---------- P1 creates obj of C1 and also P2 creates obj of C1. So two instances of Component exists in two different processes.

    If any one gone through this could you please post sample code.

    Thanks & Regards,
    Upender
    Tuesday, April 14, 2009 4:20 AM

Answers

  • Hello,

    In .NET 2.0 you could achieve this using .NET Remoting.
    In .NET 3.0/3.5 you can communicate via WCF and NetNamedPipeBinding .
    If your component is UI (or at least processes messages from message loop) you can use Windows API and PostMessage or SendMessage methods to post/send to another instance in separate process.
    Vitaliy Liptchinsky http://dotnetframeworkplanet.blogspot.com/
    • Marked as answer by Upendra,V Tuesday, April 14, 2009 11:58 AM
    Tuesday, April 14, 2009 6:44 AM

All replies

  • Hello,

    In .NET 2.0 you could achieve this using .NET Remoting.
    In .NET 3.0/3.5 you can communicate via WCF and NetNamedPipeBinding .
    If your component is UI (or at least processes messages from message loop) you can use Windows API and PostMessage or SendMessage methods to post/send to another instance in separate process.
    Vitaliy Liptchinsky http://dotnetframeworkplanet.blogspot.com/
    • Marked as answer by Upendra,V Tuesday, April 14, 2009 11:58 AM
    Tuesday, April 14, 2009 6:44 AM
  • Hi, Iam new to .Net Could you please provide sample code for Remoting?
    Tuesday, April 14, 2009 8:37 AM
  • Here you go:
    http://dotnetaddict.dotnetdevelopersjournal.com/ipc_remoting_real_world_example.htm
    Vitaliy Liptchinsky http://dotnetframeworkplanet.blogspot.com/
    Tuesday, April 14, 2009 9:11 AM