Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / February 2006

Tip: Looking for answers? Try searching our database.

COM+ LC Event - Transient Subscription (New Issue)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Blair Allen Stark - 24 Feb 2006 05:43 GMT
well I am making progress. . .

Here is where I was going with this. . .
I want an ASP.NET application to fire the event. I want users to be able to
run an app and get a real-time view of certain activities.

with these set in the COM+ Event Class assembly:
 <Assembly: ApplicationActivation(ActivationOption.Library)>  
 <Assembly: ApplicationAccessControl(Value:=False)>

I can get the event to fire between stand-alone windows applications. But
trying to fire from ASP.NET to windows app throws "unable to invoke any
subscribers"

when I have these assembly attributes set in the COM+ Event Class assembly:
<Assembly: ApplicationActivation(ActivationOption.Server)>
<Assembly: ApplicationAccessControl(Value:=False)>

But It doesnt fire from ASP.NET to windows app. . . Nothing happens at all -
ASP.NET page works as expected, no events fired in Windows app. Also, windows
to windows nothing happens.

I have just in time activation set up on the COM+ Event Class class, too.

any ideas???
"Peter Huang" [MSFT] - 24 Feb 2006 08:57 GMT
Hi,

Based on my research, there was a practical approach about LCE with Web
Application.
You may have a check.
http://www.codeproject.com/dotnet/complusnetpracticalapp03.asp

Best regards,

Peter Huang
Microsoft Online Partner Support

Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Blair Allen Stark - 27 Feb 2006 04:52 GMT
Thanks peter. . . Yeah, I had reviewed that.
Unfortunately the two examples he uses there involve notify the asp.net
application from a web page (why that is important, I dont know)
I'm stuck

> Hi,
>
[quoted text clipped - 10 lines]
> Get Secure! - www.microsoft.com/security
> This posting is provided "AS IS" with no warranties, and confers no rights.
"Peter Huang" [MSFT] - 27 Feb 2006 07:44 GMT
Hi

Based on my test, it seems that we can fire the event from Web Page to
Winform.
But we need to config the Subcriptorclass as a Library.
Based on the Sample I send to you in the newsgroup link.
1. unregister the Subcriptor class, regsvcs /u

2. Add an  event in the Subcriptor and regsvcs Subcriptor.dll
Public Class Subcriptor
   Inherits ServicedComponent
   Implements EventClass.IEventosPedidos
   Public Event TestEvent()
   Public Sub PedidoRealizado(ByVal IdPedido As Integer) Implements
EventClass.IEventosPedidos.PedidoRealizado
       Debug.WriteLine("Pedido " & IdPedido & " realizado")
       RaiseEvent TestEvent()
   End Sub
End Class

3. Code in the winform, now if we click the button, the msgbox will be
popup which means the LCE works OK.
   Dim WithEvents s As Subscriptor.Subcriptor = New Subscriptor.Subcriptor
   Dim st As New SubscripcionesTransitorias
   Dim Id As String
   Dim p As EventClass.IEventosPedidos = New EventClass.EventosPedidos

   Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
       Id = st.A?adir(s)
   End Sub

   Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
       p.PedidoRealizado(1)
   End Sub

   Private Sub s_TestEvent() Handles s.TestEvent
       MsgBox("Hello")
   End Sub

4. Add an asp.net page to fire the LCE event in codebehind
   Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
       Dim p As EventClass.IEventosPedidos = New EventClass.EventosPedidos
       p.PedidoRealizado(1)
   End Sub

Now if we click the Asp.NET button in web form the msgbox in winform will
be pop up.
The key point here is that we need to registered the Subcriptor as Library.
So that the .NET Event will be hosted in the same process where the winform
is.
If we run the Subcriptor Server, the Subcriptor will run in another
process. Because the .NET Event( which is different from the LCE event) is
similar with a function point(memory address). the function point will have
no sense in another process.

Hope this helps.

Best regards,

Peter Huang
Microsoft Online Partner Support

Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.