473,387 Members | 1,942 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,387 software developers and data experts.

System.NullReferenceException: Object reference not set to an instance of an object

Hi,

I'm trying to call a function written in a dll file, from ASP.NET 1.1 web application.

Part of code in global.asax:

<%@ Import namespace="WPPSYSTEMDLLLib" %>

Sub Application_OnStart()

Dim Value As Object

Application("WPPSystem") = new WPPSystem() <-- the name of the class

Res = Application("WppSystem").INIStrGet("WPP", "StartPage", "", Value, "c:\wpp.ini", 0)

I get the following error:

System.NullReferenceException: Object reference not set to an instance of an object

Application("WPPSystem") is not null. It does get the instance of object.

Any idea whats wrong?

Thanks a lot,

zvikorn
Jul 28 '06 #1
5 10309
Enyi
38
It could possibly be an object inside your referenced dll that hasn't been initialised. Maybe there is another method which you need to call first to initialise an object, in the dll before the method you call on the line where the error occurs in your code.
Jul 30 '06 #2
dotnet
22
you have not created a object of your WPPSystem class.

you can do it as

Dim objWPPSystem as WPPSystem






Regards
Nitin Mittal
http://www.dotnetdonkey.com
Jul 30 '06 #3
It could possibly be an object inside your referenced dll that hasn't been initialised. Maybe there is another method which you need to call first to initialise an object, in the dll before the method you call on the line where the error occurs in your code.

10x for your reply.
There is no other method to call before.
What I'm thinking is, one of the parameters has to be called by reference. in the dll its defined: byRef myStr.
How can I write it in the calling method? I cant just pass the parameter itself.
Jul 30 '06 #4
Enyi
38
Did you try what dotnet said?

Yes you can just pass the parameter itself. I'm not 100% sure about the difference between ByVal and ByRef. Try Googling for them :)
Jul 31 '06 #5
aotter
1
did you guys figure this out? I'm having exactely the same problem calling an old C++ dll from C#, it's also a function that passes a parameter by reference. I can call all the other functions in the dll that don't pass any values by reference just fine!!!
Aug 14 '06 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Terrence | last post by:
I am doing some of the C# walkthroughs to transition from VB to C#. When I try to execute static void Main() { Aplication.Run(new Form1()) } I raise a 'System.NullReferenceException" in...
7
by: mike p. | last post by:
I have a docbook xml file, and am using standard docbook 1.61.3 xsl stylesheets to do xhtml transform. Transform works fine when using MSXML. When I try to do the following using asp.net 1.1: ...
0
by: muralidharan | last post by:
WebForm1.aspx Code: <%@ Register TagPrefix="ComponentArt" Namespace="ComponentArt.Web.UI" Assembly="ComponentArt.Web.UI" %> <ComponentArt:TreeView id="TreeView1" Height="520"...
5
by: Vitling | last post by:
For no apparent reason, a NullReference exception is thrown in system.dll (System.Net.Sockets.OverlappedAsyncResult.CompletionPortCallback). Since I only get a disassembly from Visual Studio, it...
2
by: Raed Sawalha | last post by:
i have a windows form(Main) with listview, when click an item in listview i open other window form (Sub) which generate the selected item from parent window in as treeview items when click any item...
1
by: msnews.microsoft.com | last post by:
I'm trying to fill an array of objects but when I add the first object I get a NullReferenceException. ----------------------------------------------------------------------------...
4
by: Terry Mulvany | last post by:
I have a 'BasePage' (BasePage.cs) derived from System.Web.UI.Page that all my pages inherit from. I need to set some properties (either in the OnInit or constructor) based on a potential...
2
by: sxiao | last post by:
Hi, there I got a NullReferenceException when there are more than one users trying to open the same page at the same time. The senerio is: Two users logged into the web application using the...
3
by: Brano | last post by:
HI all, I have a problem i have a web application that was working fine and this morning when i run it and click on a button that does Reponse.Redirect to a page i get this error : Server...
6
by: William Mild | last post by:
I must be getting brain fried. I can't see the error. Create a new web form with the following code begind: Public Class test Inherits System.Web.UI.Page Public Class ReportCardData ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.