Previous Thread:   Forms Authentication Cookie from two applications

9/30/2005 1:12:07 PM    Application.Lock() from whitin custom class
I need some help on this issue. I am trying to lock the application object  
  
from within a vb class but I'll get the following error:  
  
Exception Details: System.NullReferenceException: Object reference not set  
  
to an instance of an object.  
  
Source Error:  
  
Line 84:         Dim i As Integer  
  
Line 85:         Dim TmpSockets(5) As String  
  
Line 86:         application.Lock()  
  
Line 87:         TmpSockets = application("sockets")  
  
Line 88:         For i = 1 To 5  
  
Source File: C:\Inetpub\wwwroot\webapp\TCPPipe.vb    Line: 86  
  
In the declarations of my class I have:  
  
Public Class TCPPipe  
  
Inherits System.Web.HttpApplication  
  
Any help / suggestion will be greatly appreciated.  
  
PS : I'm using VS.NET 2003



9/30/2005 3:24:58 PM    Solved - Application.Lock() from whitin custom class
I finally solved the issue. In the class I inserted  
  
Dim AppState As HttpApplicationState = HttpContext.Current.Application  
  
then used AppSate.Lock()  
  
"P. Prosper" <none@none> wrote in message  
  
news:eBARgJexFHA.612@TK2MSFTNGP10.phx.gbl...