Catching a 3rd party system event.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bob Kabob via DotNetMonster.com

    #1

    Catching a 3rd party system event.

    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<CBBx EventHandler>:: CreateInstance( &_bbx_event_han dler);
    TESTBBXRESULT(_ bbx_event_handl er->DispEventAdvis e(spTracer));

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

    --
    Message posted via http://www.dotnetmonster.com
  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: Catching a 3rd party system event.

    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.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "Bob Kabob via DotNetMonster.c om" <forum@nospam.D otNetMonster.co m> wrote in
    message news:b3cc4d8bdf d54dd1b07cce6f6 7059b4f@DotNetM onster.com...[color=blue]
    > 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<CBBx EventHandler>:: CreateInstance( &_bbx_event_han dler);
    > TESTBBXRESULT(_ bbx_event_handl er->DispEventAdvis e(spTracer));
    >
    > I'm sure this is easy, I just can't see the solution.
    >
    > --
    > Message posted via http://www.dotnetmonster.com[/color]


    Comment

    • Bob Kabob via DotNetMonster.com

      #3
      Re: Catching a 3rd party system event.

      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(do SomethingOnClic k);

      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:
      <whatAttachesTo This>.<whatShou ldGoHere> += new <nowWhat>

      Thanks

      Bob

      --
      Message posted via http://www.dotnetmonster.com

      Comment

      • Yama

        #4
        Re: Catching a 3rd party system event.

        Hi Bob,

        Here is a nice example:
        http://www.codeguru.com/Cpp/COM-Tech...cle.php/c3943/

        Create a delegate pointer and events that you would have to fire anytime you
        need something to happen. You can create any events you want.

        Another great example can be found at:


        Hope this helps,

        Yama

        "Bob Kabob via DotNetMonster.c om" wrote:
        [color=blue]
        > 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(do SomethingOnClic k);
        >
        > 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:
        > <whatAttachesTo This>.<whatShou ldGoHere> += new <nowWhat>
        >
        > Thanks
        >
        > Bob
        >
        > --
        > Message posted via http://www.dotnetmonster.com
        >[/color]

        Comment

        Working...