CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2002
    Location
    London
    Posts
    9

    .NET Events simple question

    Hi all... I will get straight to the point and, as always, any replies will be greatly appreciated...

    I have a web service and I want to make it an event producer... other components (windows services) will then subscribe and listen for these events..

    The problem is, all the examples I found, and followed, assume that on the listener side, you create a new eventproducer object in order to listen for the events it raises. But this is a web service. I tried making the Event in my webservice shared, but no luck, it does not appear to be fired.. or at least the listener does not catch it...

    Anybody got any ideas on how to go about doing this?

    Thanks guys,
    AP

  2. #2
    Join Date
    Jun 2001
    Location
    MO, USA
    Posts
    2,868
    There are several of us here working on the same problem it seems. This was easy to do with a Multiuse ActiveX EXE in VB 6, but there doesn't seem to be an obvious equivalent in .NET. Currently I'm studying the "Object Pooling" concept to see if the answer lies there. If you find anything, please post it!

    Thanks!

  3. #3
    Join Date
    Jun 2001
    Location
    MO, USA
    Posts
    2,868
    I finally got a simple example to work, this process will start with the first application that requests it and end when the last reference to it is lost. It returns the same shared object to all Callers:

    Imports System.EnterpriseServices
    Imports System
    Imports System.Windows.Forms
    Imports System.Reflection
    'Sets the assembly Name
    <Assembly: ApplicationName("Svr1")>

    '***** KEY TO Out-of-Process
    'Tells it this is an out-of-Process server
    'The other option is Library with means create in-process
    <Assembly: ApplicationActivation(Activationoption.Server)>
    'Key pair used to sign the assembly
    <Assembly: AssemblyKeyFile("c:\net\svr\Svr1.snk")>

    Public Class SvrCls
    Inherits ServicedComponent
    Shared m_Var As String
    Shared Sub New()

    End Sub
    Public Property VarValue() As String
    Get
    VarValue = m_Var
    End Get
    Set(ByVal Value As String)
    m_Var = Value
    End Set
    End Property
    End Class

  4. #4
    Join Date
    Jun 2002
    Location
    London
    Posts
    9
    Thanks dude... I will try it tonight and let you know..

    Kind regards,
    AP

  5. #5
    Join Date
    Jun 2002
    Location
    London
    Posts
    9
    How would you apply that to a web service though??

    Kind regards,
    AP

  6. #6
    Join Date
    Jun 2001
    Location
    MO, USA
    Posts
    2,868
    Don't know... never created a web service.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured