Link to home
Start Free TrialLog in
Avatar of james henderson
james hendersonFlag for United States of America

asked on

c# receive events from another application

I have a 3rd party application that provides external access through an extension api.  the way that works is that we provide a dll that references the extension api and will receive event notifications from the extension api as well as pass commands to the extension api.  My dll must reside in a sub folder of the 3rd party app, so that when the app loads it will then load my dll.

Here is my problem:  I don't know how to communicate with my dll.  Here's what I mean:
1. my application starts the 3rd party application via process.start();  this works perfectly.
2. the 3rd party app starts and loads my dll, which starts receiving events from the 3rd party app.
3. PROBLEM:  I can't receive the events from my dll!

I've tried referencing my dll and the 3rd party extension api dll in my own app, then instantiating the dll, but that doesn't work .

Can someone please provide some basic direction on what I'm doing wrong?  I really need this to work soon.
Avatar of unknown_routine
unknown_routine
Flag of United States of America image

I can't receive the events from my dll!


I assume your 3rd party dll is a .NET dll,

So in your 3rd party dll you must have bunch of classes. are events defined in those classes? in not there won't be any event on your side.


If events are defined properly defined in your 3rd party dll , all you need to define in your code is a an event handler . That's all!

So:

1: get the 3rd party dll documentation

2: see what classes are defined and what events

3: create an event handler (with the correct signature)Make sure event handler is wired correctly to the event.
Avatar of james henderson

ASKER

sorry, I'm not explaining correctly.  here is a snippet that my dll is handling:

        public void Agent_AgentLoggedIn()
        {
            _platform.WindowOwner.CurrentContext.Send(delegate
            {
                MessageBox.Show("Agent Logged In");
            }, null);

        }

this event uses a delegate to display a message box.  it works fine.  however I don't know what I should do in my application to receive this event rather than have the message box display.  I should also point out that this is comming from the copy of the dll I have placed in the 3rd party application folder.
SOLUTION
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
that's what I'm running into.  so how would I go about doing that?
and could ipc handle more than one object?  say, an object on a web page?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial