Catching a 3rd party system event.

  • Thread starter Bob Kabob via DotNetMonster.com
  • Start date
B

Bob Kabob via DotNetMonster.com

I'm trying to include 3rd party tools into a C# project but they (the 3rd
party company) only have an example of C++ code and no documention. They
also have a VB example and if you know of something that will port from VB
to C# I could try that.

Primarily I just want to capture a system event.

This is the event:
BBXCOMSERVERLib.BBxEvent_t.BBX_EVENT_PROCESS_STARTED

This is the C++:
CComObject<CBBxEventHandler>::CreateInstance(&_bbx_event_handler);
TESTBBXRESULT(_bbx_event_handler->DispEventAdvise(spTracer));

I'm sure this is easy, I just can't see the solution.
 
N

Nicholas Paldino [.NET/C# MVP]

Bob,

It looks like they supplied you with a COM component. You should be
able to set a reference to this component in your project and it will create
a wrapper that you can use in .NET (which will also expose the appropriate
events as well).

Hope this helps.
 
B

Bob Kabob via DotNetMonster.com

If I understand you correctly your telling me to add the reference to the
project in the solution explorer - Yes?

I got that far. My problem is adding the event to the code. i.e.

I can see to add an event handler for a button click
someThing.Click += new EventHandler(doSomethingOnClick);

but I can't see how to add the handler, method or anything pertaining to a
3rd party event.

i.e. If an event happens on the system, for example some process starts,
then how do I catch that? What can I use to catch it and how do I set it
up?
Using the same idea as above:
<whatAttachesToThis>.<whatShouldGoHere> += new <nowWhat>

Thanks

Bob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top