473,324 Members | 2,178 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

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
Nov 19 '05 #1
1 1641
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:eB*************@TK2MSFTNGP10.phx.gbl...
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

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Google Mike | last post by:
I need an Application object replacement. I was creating my own using shared memory -- shm* API in PHP. I was doing fine for 6 months until it just got too fat, I guess, and the RH9 Linux server...
0
by: Brett | last post by:
I am working with vb.net in a asp.net application. I have created a config file in xml format. The goal is to be able to change the config file without having to recompile the entire...
8
by: Gaensh | last post by:
HI, I have a singleton pattern to acess my database the following is the sample code use to implement singleton pattern public class DataAccessHelper { private static DataAccessHelper instance;...
2
by: mark | last post by:
Can't figure this one out. I appears to not be code related. After surfing my asp.net web app for a while 5 - 10 min. it fails to open any further connections to my access 2000 database. There...
2
by: zorro | last post by:
Hello there, To lock or not to lock, that is my question... I have an arrayList in my application object. The arrayList contains objects of a class that I defined. I have my own mechanisms...
0
by: Ryan Linneman via .NET 247 | last post by:
I have a simple program to read data from a touchscreen overEthernet using a custom DLL provided by the touchscreenmanufacturer, and I want to read this data using the threadpool.When I use the...
4
by: John Cosmas | last post by:
I need to execute some threads that load items into my APPLICATION object. I haven't figured out how to do that when I fire off a thread on a page, that takes its time and loads data into the...
5
by: Frank Moyles | last post by:
I am a developer with many years (approx 10years) development experience using C++ for DESKTOP applications. I am writing a web application using C#, and I wanted to ask a question about...
6
by: DaveRook | last post by:
Hi I have some code from a friend and I don't understand why they have used the application lock feature! I understand this produces a random quote, but can some one explain to me what happens...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.