delegate problem in translate from c#

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • is_vlb50@hotmail.com

    delegate problem in translate from c#

    I have problem with translate next code from c# to vb :


    private UStateEventHand ler _myUStateEventH andler;

    //where UStateEventHand ler is defined as :
    //public sealed delegate UStateEventHand ler : System.Multicas tDelegate


    // Create the event handlers we need.
    _myUStateEventH andler = _obj1.CreateEve ntHandler(new
    UStateEventHand ler(OnUserState Change));

    // Add the event handlers to the session-global events.
    obj1.UStateChan ged += _myUStateEventH andler;

    //where UStateChanged defined in class library as:
    //public abstract new event UStateEventHand ler UStateChanged

    How I can translate to vb +- ?
    Thanks
  • Cor Ligthert[MVP]

    #2
    Re: delegate problem in translate from c#

    Hi,

    Have a look where the instanced class that is about this
    _myUStateEventH andler

    Then declare it globaly "WithEvents " (this does not exist in C#)

    Then put at the end of the method that is handled handles.blabla

    Probably the most simple

    Cor

    <is_vlb50@hotma il.comschreef in bericht
    news:b0114442-5c03-41a9-965b-182abdd8d7ba@j2 2g2000hsf.googl egroups.com...
    >I have problem with translate next code from c# to vb :
    >
    >
    private UStateEventHand ler _myUStateEventH andler;
    >
    //where UStateEventHand ler is defined as :
    //public sealed delegate UStateEventHand ler : System.Multicas tDelegate
    >
    >
    // Create the event handlers we need.
    _myUStateEventH andler = _obj1.CreateEve ntHandler(new
    UStateEventHand ler(OnUserState Change));
    >
    // Add the event handlers to the session-global events.
    obj1.UStateChan ged += _myUStateEventH andler;
    >
    //where UStateChanged defined in class library as:
    //public abstract new event UStateEventHand ler UStateChanged
    >
    How I can translate to vb +- ?
    Thanks

    Comment

    • =?Utf-8?B?RGF2aWQgQW50b24=?=

      #3
      RE: delegate problem in translate from c#

      Event handlers can be wired dynamically via 'AddHandler' in VB.
      --
      Source code converters: Convert between C#, C++, Java, and VB with the most accurate and reliable source code converters

      C++ to C#
      C++ to VB
      C++ to Java
      Java to VB & C#
      Instant C#: convert VB to C#
      Instant VB: convert C# to VB
      Instant C++: VB, C#, or Java to C++/CLI


      "is_vlb50@hotma il.com" wrote:
      I have problem with translate next code from c# to vb :
      >
      >
      private UStateEventHand ler _myUStateEventH andler;
      >
      //where UStateEventHand ler is defined as :
      //public sealed delegate UStateEventHand ler : System.Multicas tDelegate
      >
      >
      // Create the event handlers we need.
      _myUStateEventH andler = _obj1.CreateEve ntHandler(new
      UStateEventHand ler(OnUserState Change));
      >
      // Add the event handlers to the session-global events.
      obj1.UStateChan ged += _myUStateEventH andler;
      >
      //where UStateChanged defined in class library as:
      //public abstract new event UStateEventHand ler UStateChanged
      >
      How I can translate to vb +- ?
      Thanks
      >

      Comment

      Working...