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

Class: Unhandled Exception--Don't understand what's happening.

RDI
Both of the fail messages are dialog boxes that say "An unhandeled exception of type 'System.NullReferenceException' occured in WindowsApplication5.exe

"Additional information: Object reference not set to an instance of an object."

Does anyone have any idea what could be going on now?

TIA

Public Class ExtensionList
Public Description As String
Public Extension As String
End Class

Public Sub ParseExt()
Dim Ext2 as ExtensionList
Dim Ext(0) as ExtensionList

Ext2.Description = "T" 'fails
Ext(0).Description = "T" 'fails

end sub
--

RDI

(remove the exclamation from the email address)

Nov 20 '05 #1
3 869
RDI
Correction: That SHOULD have read

Public Class ExtensionList
Public Description As String
Public Extension As String
End Class

Public Sub ParseExt()
Dim Ext2 as ExtensionList
Dim Ext(2) as ExtensionList

Ext2.Description = "T" 'fails
Ext(0).Description = "T" 'fails

--

RDI

(remove the exclamation from the email address)

"RDI" <RDI!@!WriteMe.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl...
Both of the fail messages are dialog boxes that say "An unhandeled exception of type 'System.NullReferenceException' occured in WindowsApplication5.exe

"Additional information: Object reference not set to an instance of an object."

Does anyone have any idea what could be going on now?

TIA

Public Class ExtensionList
Public Description As String
Public Extension As String
End Class

Public Sub ParseExt()
Dim Ext2 as ExtensionList
Dim Ext(0) as ExtensionList

Ext2.Description = "T" 'fails
Ext(0).Description = "T" 'fails

end sub


--

RDI

(remove the exclamation from the email address)

Nov 20 '05 #2
You didn't declare your variables with NEW.
Public Sub ParseExt()

'-- Declare using new
Dim Ext2 As New ExtensionList()
Dim Ext(2) As ExtensionList
Ext(0) = New ExtensionList()
Ext(1) = New ExtensionList()
Ext(2) = New ExtensionList()
Ext2.Description = "T" 'fails
Ext(0).Description = "T" 'fails

End Sub
Nov 20 '05 #3
RDI
Brian,

Thanks for the response. I just got back from my Thanksgiving vacation or I
would've replied sooner.

I could swear that I've declared similar arrays without using NEW. But I'll
look into it.

Thanks again.

--

RDI

(remove the exclamation from the email address)

"Brian" <no****@prairie.lakes.com> wrote in message
news:vs************@corp.supernews.com...
You didn't declare your variables with NEW.
Public Sub ParseExt()

'-- Declare using new
Dim Ext2 As New ExtensionList()
Dim Ext(2) As ExtensionList
Ext(0) = New ExtensionList()
Ext(1) = New ExtensionList()
Ext(2) = New ExtensionList()
Ext2.Description = "T" 'fails
Ext(0).Description = "T" 'fails

End Sub

Nov 20 '05 #4

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

Similar topics

5
by: Guenther Sohler | last post by:
Hallo, I have written a very small testcase to try threads within classes My code is following: #include <stdio.h> #include <unistd.h> #include <pthread.h>
7
by: Nick Beenham | last post by:
Can anyone give me a tip on how to pass a value from a class to a windows form. e.g. adding text to a textbox. public class AnotherClass { //usual class code public void AddText() {
1
by: g35rider | last post by:
Hi, I am trying to understand from C++ point of view what the problem is. I have a file called. Controllers.h in which I have a base class Controller and couple of other sub classes...
14
by: lovecreatesbea... | last post by:
Could you tell me how many class members the C++ language synthesizes for a class type? Which members in a class aren't derived from parent classes? I have read the book The C++ Programming...
4
by: jx2 | last post by:
can any1 give me a good example for cli or CGI or comand line usage i've read the description on php.net but i just dont understand whats going on what do you use it for and how - i managed to run...
2
by: babu198649 | last post by:
hi i came across this following code could some one explain whats happening with the int refCount(ie.how can an argument be passed to an int) in constructor. class SharedImage { public: ...
2
by: parag_paul | last post by:
#include <stdio.h> #define f(a,b) a##b #define g(a) #a #define h(a) g(a) int main() { printf("%s\n",h(f(1,2))); printf("%s\n",g(f(1,2))); return 0;
13
by: Anarki | last post by:
#include <iostream> using namespace std; class ConstantMember { const int m_const; public: ConstantMember(int cons = 10):m_const(cons){} int getConst() const{ return m_const;} };
10
by: sagitalk | last post by:
Here is my code: #include <iostream> #include <vector> #include <fstream> #include <stdio.h> #include <string> #include <cstring> using namespace std;
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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.